From 4dfafdbed48f42b3c7314693c55be758b5743c51 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Sun, 17 Jan 2021 11:28:20 -0500 Subject: [PATCH] removing comp.* link.* files as we now use the cmplr.env (#284) * removing file that should not be in repository * adding to .gitignore to avoid future .*.swp files * remove unused files from aux directory * removing comp.* link.* files as we now use the cmplr.env --- .gitignore | 4 + model/aux/1source.gs | 1150 --- model/aux/cbarn.gs | 241 - model/aux/colorset.gs | 70 - model/aux/idl_twist/README | 11 - model/aux/idl_twist/TWIST_init.txt | 28 - model/aux/idl_twist/bathytool.pro | 735 -- model/aux/idl_twist/editspecials.pro | 268 - model/aux/idl_twist/gridbuild.pro | 4504 --------- model/aux/idl_twist/initmain.pro | 501 - model/aux/idl_twist/julday.pro | 189 - model/aux/idl_twist/make_visu_package.pro | 14 - model/aux/idl_twist/make_visu_tar.sh | 6 - model/aux/idl_twist/maketransect.pro | 460 - model/aux/idl_twist/mapping.pro | 99 - model/aux/idl_twist/palette.pro | 614 -- model/aux/idl_twist/palettes/6coul.ct | 42 - model/aux/idl_twist/palettes/Depth.ct | 42 - .../aux/idl_twist/palettes/Depth_finistere.ct | 42 - .../idl_twist/palettes/Depth_land_lakes.ct | 42 - model/aux/idl_twist/palettes/Eb.ct | 42 - model/aux/idl_twist/palettes/Eb_for_eps.ct | 39 - model/aux/idl_twist/palettes/Hs.ct | 42 - model/aux/idl_twist/palettes/Hsb.ct | 42 - model/aux/idl_twist/palettes/Hsb2.ct | 42 - model/aux/idl_twist/palettes/JFM8a.ct | 42 - model/aux/idl_twist/palettes/SWAO_dir.ct | 39 - model/aux/idl_twist/palettes/S_sym.ct | 42 - model/aux/idl_twist/palettes/Tp_SAR.ct | 39 - model/aux/idl_twist/palettes/backtoblack.ct | 42 - model/aux/idl_twist/palettes/bathy.ct | 42 - model/aux/idl_twist/palettes/bathy2.ct | 42 - model/aux/idl_twist/palettes/bathy3.ct | 42 - model/aux/idl_twist/palettes/bathy3white.ct | 42 - model/aux/idl_twist/palettes/bathy4.ct | 42 - model/aux/idl_twist/palettes/bathygif.ct | 42 - model/aux/idl_twist/palettes/bwflipped.ct | 42 - model/aux/idl_twist/palettes/current_v0.ct | 39 - model/aux/idl_twist/palettes/dg_hs.ct | 42 - model/aux/idl_twist/palettes/doppler2.ct | 42 - model/aux/idl_twist/palettes/doppler3.ct | 42 - model/aux/idl_twist/palettes/doppler4.ct | 42 - model/aux/idl_twist/palettes/doppler4_inv.ct | 42 - model/aux/idl_twist/palettes/doppler5.ct | 42 - model/aux/idl_twist/palettes/doppler5_inv.ct | 42 - model/aux/idl_twist/palettes/doppler5w.ct | 42 - model/aux/idl_twist/palettes/doppler6.ct | 42 - model/aux/idl_twist/palettes/doppler6w.ct | 42 - model/aux/idl_twist/palettes/doppler7.ct | 42 - model/aux/idl_twist/palettes/doppler7bw.ct | 42 - model/aux/idl_twist/palettes/doppler7bw2.ct | 42 - .../palettes/doppler_modified_land.ct | 42 - .../palettes/doppler_modified_land_2.ct | 39 - .../palettes/doppler_modified_land_2_eps.ct | 39 - model/aux/idl_twist/palettes/e.ct | 42 - model/aux/idl_twist/palettes/fe.ct | 42 - model/aux/idl_twist/palettes/onr2000.ct | 42 - model/aux/idl_twist/palettes/pastels.ct | 42 - model/aux/idl_twist/palettes/pastels2.ct | 42 - model/aux/idl_twist/palettes/pastels3.ct | 42 - model/aux/idl_twist/palettes/previmer_hs.ct | 39 - model/aux/idl_twist/palettes/previmer_hs2.ct | 39 - model/aux/idl_twist/palettes/previmer_hs3.ct | 39 - model/aux/idl_twist/palettes/previmer_hs4.ct | 39 - .../idl_twist/palettes/previmer_hs_nogray.ct | 42 - .../idl_twist/palettes/previmer_tp_nogray.ct | 39 - model/aux/idl_twist/palettes/raibow+.ct | 42 - model/aux/idl_twist/palettes/rainbowbw.ct | 42 - model/aux/idl_twist/palettes/ripplescoul.ct | 42 - model/aux/idl_twist/palettes/ripplesgrey.ct | 42 - model/aux/idl_twist/palettes/s.ct | 42 - model/aux/idl_twist/palettes/s2.ct | 42 - model/aux/idl_twist/palettes/s3_1.ct | 42 - model/aux/idl_twist/palettes/symbols.ct | 39 - model/aux/idl_twist/palettes/symbols_dark.ct | 39 - model/aux/idl_twist/palettes/topobathy.ct | 39 - model/aux/idl_twist/palettes/wavespec_new.ct | 42 - model/aux/idl_twist/palettes/wbw.ct | 42 - model/aux/idl_twist/palettes/ws_ftp.log | 26 - model/aux/idl_twist/palettes/z_dopsat_red.ct | 39 - model/aux/idl_twist/parametros.pro | 332 - model/aux/idl_twist/rayp.f90 | 545 -- model/aux/idl_twist/raypf.f90 | 604 -- model/aux/idl_twist/raypfc.f90 | 756 -- model/aux/idl_twist/raypg.f90 | 574 -- model/aux/idl_twist/raypg_rayleigh.f90 | 571 -- model/aux/idl_twist/raytracer.pro | 403 - model/aux/idl_twist/read_timeseries.pro | 595 -- model/aux/idl_twist/rt_visumain.pro | 8715 ----------------- model/aux/idl_twist/visu.pro | 14 - model/aux/idl_twist/xloadpalette.pro | 628 -- model/aux/make_multi_nco_cray | 304 - .../matlab/example_plot_from_netcdf_rect.m | 42 - .../matlab/example_plot_from_netcdf_unst.m | 47 - .../matlab/example_plotf_from_netcdf_rect.m | 68 - model/aux/matlab/example_read_spectrum.m | 184 - model/aux/matlab/read_WWNCUG_var.m | 84 - model/aux/matlab/read_WWNC_var.m | 90 - model/aux/matlab/read_WWNCf_var.m | 287 - model/aux/matlab/read_outf_hs_generic.m | 146 - model/aux/matlab/read_scalar.m | 78 - model/aux/matlab/write_x_and_y_example.m | 88 - model/aux/profile.gs | 555 -- model/aux/source.gs | 1150 --- model/aux/spec.gs | 825 -- model/aux/spec_ids.gen | 2 - model/bin/comp.Altix | 191 - model/bin/comp.Altix_debug | 194 - model/bin/comp.DATARMOR | 293 - model/bin/comp.DATARMOR_debug | 293 - model/bin/comp.Gnu | 201 - model/bin/comp.Gnu_debug | 201 - model/bin/comp.Intel | 211 - model/bin/comp.Intel_debug | 203 - model/bin/comp.Lahey | 192 - model/bin/comp.Mpt | 191 - model/bin/comp.Mpt_debug | 192 - model/bin/comp.NEC | 209 - model/bin/comp.Portland | 237 - model/bin/comp.SGI_Xeon_Intel | 201 - model/bin/comp.cray_xc.Intel | 197 - model/bin/comp.cray_xc.Portland | 223 - model/bin/comp.cray_xt | 211 - model/bin/comp.datamor.intel | 211 - model/bin/comp.kubuntu.intel.mpich | 211 - model/bin/comp.mac_pro_Intel | 198 - model/bin/comp.xlf | 228 - model/bin/link.Gnu | 197 - model/bin/link.Gnu_debug | 197 - model/bin/link.Intel | 208 - model/bin/link.Intel_debug | 206 - model/bin/link.Lahey | 196 - model/bin/link.Mpt | 198 - model/bin/link.Mpt_debug | 197 - model/bin/link.NEC | 194 - model/bin/link.Portland | 196 - model/bin/link.SGI_Xeon_Intel | 203 - model/bin/link.cray_xc.Intel | 205 - model/bin/link.cray_xc.Portland | 199 - model/bin/link.cray_xt | 191 - model/bin/link.kubuntu.intel.mpich | 210 - model/bin/link.mac_pro_Intel | 200 - model/bin/link.xlf | 208 - .../input/.ww3_multi_grdset_aa.inp.swp | Bin 12288 -> 0 bytes 144 files changed, 4 insertions(+), 36897 deletions(-) delete mode 100644 model/aux/1source.gs delete mode 100644 model/aux/cbarn.gs delete mode 100644 model/aux/colorset.gs delete mode 100644 model/aux/idl_twist/README delete mode 100644 model/aux/idl_twist/TWIST_init.txt delete mode 100644 model/aux/idl_twist/bathytool.pro delete mode 100755 model/aux/idl_twist/editspecials.pro delete mode 100644 model/aux/idl_twist/gridbuild.pro delete mode 100755 model/aux/idl_twist/initmain.pro delete mode 100644 model/aux/idl_twist/julday.pro delete mode 100755 model/aux/idl_twist/make_visu_package.pro delete mode 100755 model/aux/idl_twist/make_visu_tar.sh delete mode 100755 model/aux/idl_twist/maketransect.pro delete mode 100644 model/aux/idl_twist/mapping.pro delete mode 100755 model/aux/idl_twist/palette.pro delete mode 100755 model/aux/idl_twist/palettes/6coul.ct delete mode 100755 model/aux/idl_twist/palettes/Depth.ct delete mode 100755 model/aux/idl_twist/palettes/Depth_finistere.ct delete mode 100755 model/aux/idl_twist/palettes/Depth_land_lakes.ct delete mode 100755 model/aux/idl_twist/palettes/Eb.ct delete mode 100644 model/aux/idl_twist/palettes/Eb_for_eps.ct delete mode 100755 model/aux/idl_twist/palettes/Hs.ct delete mode 100755 model/aux/idl_twist/palettes/Hsb.ct delete mode 100755 model/aux/idl_twist/palettes/Hsb2.ct delete mode 100755 model/aux/idl_twist/palettes/JFM8a.ct delete mode 100755 model/aux/idl_twist/palettes/SWAO_dir.ct delete mode 100755 model/aux/idl_twist/palettes/S_sym.ct delete mode 100644 model/aux/idl_twist/palettes/Tp_SAR.ct delete mode 100755 model/aux/idl_twist/palettes/backtoblack.ct delete mode 100755 model/aux/idl_twist/palettes/bathy.ct delete mode 100755 model/aux/idl_twist/palettes/bathy2.ct delete mode 100755 model/aux/idl_twist/palettes/bathy3.ct delete mode 100755 model/aux/idl_twist/palettes/bathy3white.ct delete mode 100755 model/aux/idl_twist/palettes/bathy4.ct delete mode 100755 model/aux/idl_twist/palettes/bathygif.ct delete mode 100755 model/aux/idl_twist/palettes/bwflipped.ct delete mode 100644 model/aux/idl_twist/palettes/current_v0.ct delete mode 100755 model/aux/idl_twist/palettes/dg_hs.ct delete mode 100755 model/aux/idl_twist/palettes/doppler2.ct delete mode 100755 model/aux/idl_twist/palettes/doppler3.ct delete mode 100755 model/aux/idl_twist/palettes/doppler4.ct delete mode 100755 model/aux/idl_twist/palettes/doppler4_inv.ct delete mode 100755 model/aux/idl_twist/palettes/doppler5.ct delete mode 100755 model/aux/idl_twist/palettes/doppler5_inv.ct delete mode 100755 model/aux/idl_twist/palettes/doppler5w.ct delete mode 100755 model/aux/idl_twist/palettes/doppler6.ct delete mode 100755 model/aux/idl_twist/palettes/doppler6w.ct delete mode 100755 model/aux/idl_twist/palettes/doppler7.ct delete mode 100755 model/aux/idl_twist/palettes/doppler7bw.ct delete mode 100755 model/aux/idl_twist/palettes/doppler7bw2.ct delete mode 100755 model/aux/idl_twist/palettes/doppler_modified_land.ct delete mode 100755 model/aux/idl_twist/palettes/doppler_modified_land_2.ct delete mode 100644 model/aux/idl_twist/palettes/doppler_modified_land_2_eps.ct delete mode 100755 model/aux/idl_twist/palettes/e.ct delete mode 100755 model/aux/idl_twist/palettes/fe.ct delete mode 100755 model/aux/idl_twist/palettes/onr2000.ct delete mode 100755 model/aux/idl_twist/palettes/pastels.ct delete mode 100755 model/aux/idl_twist/palettes/pastels2.ct delete mode 100755 model/aux/idl_twist/palettes/pastels3.ct delete mode 100755 model/aux/idl_twist/palettes/previmer_hs.ct delete mode 100755 model/aux/idl_twist/palettes/previmer_hs2.ct delete mode 100755 model/aux/idl_twist/palettes/previmer_hs3.ct delete mode 100755 model/aux/idl_twist/palettes/previmer_hs4.ct delete mode 100755 model/aux/idl_twist/palettes/previmer_hs_nogray.ct delete mode 100644 model/aux/idl_twist/palettes/previmer_tp_nogray.ct delete mode 100755 model/aux/idl_twist/palettes/raibow+.ct delete mode 100755 model/aux/idl_twist/palettes/rainbowbw.ct delete mode 100755 model/aux/idl_twist/palettes/ripplescoul.ct delete mode 100755 model/aux/idl_twist/palettes/ripplesgrey.ct delete mode 100755 model/aux/idl_twist/palettes/s.ct delete mode 100755 model/aux/idl_twist/palettes/s2.ct delete mode 100755 model/aux/idl_twist/palettes/s3_1.ct delete mode 100755 model/aux/idl_twist/palettes/symbols.ct delete mode 100644 model/aux/idl_twist/palettes/symbols_dark.ct delete mode 100644 model/aux/idl_twist/palettes/topobathy.ct delete mode 100755 model/aux/idl_twist/palettes/wavespec_new.ct delete mode 100755 model/aux/idl_twist/palettes/wbw.ct delete mode 100755 model/aux/idl_twist/palettes/ws_ftp.log delete mode 100644 model/aux/idl_twist/palettes/z_dopsat_red.ct delete mode 100755 model/aux/idl_twist/parametros.pro delete mode 100755 model/aux/idl_twist/rayp.f90 delete mode 100755 model/aux/idl_twist/raypf.f90 delete mode 100644 model/aux/idl_twist/raypfc.f90 delete mode 100755 model/aux/idl_twist/raypg.f90 delete mode 100644 model/aux/idl_twist/raypg_rayleigh.f90 delete mode 100755 model/aux/idl_twist/raytracer.pro delete mode 100644 model/aux/idl_twist/read_timeseries.pro delete mode 100644 model/aux/idl_twist/rt_visumain.pro delete mode 100755 model/aux/idl_twist/visu.pro delete mode 100755 model/aux/idl_twist/xloadpalette.pro delete mode 100755 model/aux/make_multi_nco_cray delete mode 100644 model/aux/matlab/example_plot_from_netcdf_rect.m delete mode 100644 model/aux/matlab/example_plot_from_netcdf_unst.m delete mode 100644 model/aux/matlab/example_plotf_from_netcdf_rect.m delete mode 100755 model/aux/matlab/example_read_spectrum.m delete mode 100644 model/aux/matlab/read_WWNCUG_var.m delete mode 100644 model/aux/matlab/read_WWNC_var.m delete mode 100644 model/aux/matlab/read_WWNCf_var.m delete mode 100644 model/aux/matlab/read_outf_hs_generic.m delete mode 100644 model/aux/matlab/read_scalar.m delete mode 100644 model/aux/matlab/write_x_and_y_example.m delete mode 100644 model/aux/profile.gs delete mode 100644 model/aux/source.gs delete mode 100644 model/aux/spec.gs delete mode 100644 model/aux/spec_ids.gen delete mode 100755 model/bin/comp.Altix delete mode 100755 model/bin/comp.Altix_debug delete mode 100755 model/bin/comp.DATARMOR delete mode 100755 model/bin/comp.DATARMOR_debug delete mode 100755 model/bin/comp.Gnu delete mode 100755 model/bin/comp.Gnu_debug delete mode 100755 model/bin/comp.Intel delete mode 100755 model/bin/comp.Intel_debug delete mode 100755 model/bin/comp.Lahey delete mode 100755 model/bin/comp.Mpt delete mode 100755 model/bin/comp.Mpt_debug delete mode 100755 model/bin/comp.NEC delete mode 100755 model/bin/comp.Portland delete mode 100755 model/bin/comp.SGI_Xeon_Intel delete mode 100755 model/bin/comp.cray_xc.Intel delete mode 100755 model/bin/comp.cray_xc.Portland delete mode 100755 model/bin/comp.cray_xt delete mode 100755 model/bin/comp.datamor.intel delete mode 100755 model/bin/comp.kubuntu.intel.mpich delete mode 100755 model/bin/comp.mac_pro_Intel delete mode 100755 model/bin/comp.xlf delete mode 100755 model/bin/link.Gnu delete mode 100755 model/bin/link.Gnu_debug delete mode 100755 model/bin/link.Intel delete mode 100755 model/bin/link.Intel_debug delete mode 100755 model/bin/link.Lahey delete mode 100755 model/bin/link.Mpt delete mode 100755 model/bin/link.Mpt_debug delete mode 100755 model/bin/link.NEC delete mode 100755 model/bin/link.Portland delete mode 100755 model/bin/link.SGI_Xeon_Intel delete mode 100755 model/bin/link.cray_xc.Intel delete mode 100755 model/bin/link.cray_xc.Portland delete mode 100755 model/bin/link.cray_xt delete mode 100755 model/bin/link.kubuntu.intel.mpich delete mode 100755 model/bin/link.mac_pro_Intel delete mode 100755 model/bin/link.xlf delete mode 100644 regtests/ww3_tp2.17/input/.ww3_multi_grdset_aa.inp.swp diff --git a/.gitignore b/.gitignore index de14dfa6c..b43cb68a2 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,7 @@ model/bin/wwatch3.env */*.swp */*/*.swp */*/*/*.swp +.*.swp +*/.*.swp +*/*/.*.swp +*/*/*/.*.swp diff --git a/model/aux/1source.gs b/model/aux/1source.gs deleted file mode 100644 index 8fc3a1b69..000000000 --- a/model/aux/1source.gs +++ /dev/null @@ -1,1150 +0,0 @@ -* -* 1source.gs : GrADS plots of source terms -* ---------------------------------------------------------------- -* version 2: color of bw option added -* polar / Cartesian option added -* -* This is a generic grads scripts that runs without modifications -* for arbitary numbers of output locations and times. If one plot -* is asked for, a page filling spectrum is plotted. If more are -* asked for, spectral are grouped per time, with 4 or six plots -* on the page. -* -* Scripts and files used : -* colorset.gs : Sets up shading colors -* spec_ids : Grid and center ID's, defaults if not given -* ww3.spec.grads : GrADS data file. -* ww3.spec.ctl : GrADS control file. -* ww3.mean.grads : Suplemental GrAds data file. -* -* The files ww3.* are generated automatically by gx_outp -* (WAVEWATCH postprocessor). -* -* General set up - - - - - - - - - - - - - - - - - - - - - - - - - -* - display=white -* -* color : color or b&w [yes/---] -* polar : polar repres. [yes/---] -* - color = 'yes' - polar = ' es' -* - if ( polar = 'yes' ) -* -* dth : grid directional increment for polar plot -* dfr : grid frequency increment for polar plot -* fmx : maximum frequency in polar plot -* - dth = 15 - dfr = 0.05 - fmx = 0.25 - else -* -* thoff : direction at bottom of plot -* dth : grid directional increment for Cartesian plot -* dfr : grid frequency increment for Cartesian plot -* fmn : maximum frequency in Cartesian plot -* fmx : minimum frequency in Cartesian plot -* - thoff = -180. - dth = 45. - dfr = 0.05 - fmn = 0.0412 - fmx = 0.4056 - endif -* -* Set ilev to chose which source term to plot -* 1 : spectrum -* 2 : input -* 3 : interactions -* 4 : whitecacpping -* 5 : bottom friction -* 6 : all together -* - ilev = 3 -* - 'set display color ' display - 'clear' - 'run colorset.gs' -* -* ID strings from file - - - - - - - - - - - - - - - - - - - - - - -* - result = read (spec_ids) - OK = sublin(result,1) - if ( OK = '0' ) - grid_ID = sublin(result,2) - else - grid_ID = 'unidentified grid' - endif -* - result = read (spec_ids) - OK = sublin(result,1) - if ( OK = '0' ) - center_ID = sublin(result,2) ', ' - else - center_ID = '' - endif -* -* Current date and time - - - - - - - - - - - - - - - - - - - - - -* - gdate="yyyy/mm/dd" - '!date -u "+%Y/%m/%d" > tmp_grads_gdate' - result = read (tmp_grads_gdate) - gdate = sublin(result,2) - '!rm -f tmp_grads_gdate' -* - center_ID = center_ID gdate -* -* Get size of page - - - - - - - - - - - - - - - - - - - - - - - - -* - 'q gxinfo' - line = sublin(result,2) - xmax = subwrd(line,4) - ymax = subwrd(line,6) -* -* Print initial info to screen - - - - - - - - - - - - - - - - - - -* - say ' ' - say '--------------------------' - say '*** Running 1source.gs ***' - say '--------------------------' - say ' ' - say 'Grid ID : ' grid_ID - say 'Center ID : ' center_ID - say 'Page : ' xmax ' by ' ymax -* -* Open data file - - - - - - - - - - - - - - - - - - - - - - - - - -* - 'open ww3.spec' -* -* Get some info for file - - - - - - - - - - - - - - - - - - - - - -* - 'q file 1' - line = sublin(result,5) - ntime = subwrd(line,12) - line = sublin(result,6) - nloc = subwrd(line,5) -* - say 'Nr. of times : ' ntime - say 'Nr. of loc. : ' nloc -* - iloc = 1 - while ( iloc <= nloc ) - iline = 6 + iloc - line = sublin(result,iline) - par_ID.iloc = subwrd(line,1) - loc_ID.iloc = substr(line,21,10) - say ' location ' iloc ' is called ' loc_ID.iloc ' and stored as ' par_ID.iloc - iloc = iloc + 1 - endwhile -* -* loop over time and location to get mean pars and max - - - - - - -* - say ' ' - say 'Reading mean data and getting maximum spectral density ...' - 'set gxout stat' -* - fmin = 1.e20 - fmax = -1.e20 - 'set lev ' ilev -* - itime = 1 - while ( itime <= ntime ) -* - 'set t ' itime - say ' processing time ' showtime(itime) -* - iloc = 1 - while ( iloc <= nloc ) -* - result = read (ww3.mean.grads) - line = sublin(result,2) - ua.iloc.itime = subwrd(line,5) - ux.iloc.itime = subwrd(line,6) - uy.iloc.itime = subwrd(line,7) - ca.iloc.itime = subwrd(line,9) - cx.iloc.itime = subwrd(line,10) - cy.iloc.itime = subwrd(line,11) - hs.iloc.itime = subwrd(line,12) -* -* say result -* say iloc ' ' itime ' ' hs.iloc.itime -* say ua.iloc.itime ' ' ux.iloc.itime ' ' uy.iloc.itime -* say ca.iloc.itime ' ' cx.iloc.itime ' ' cy.iloc.itime -* - 'd ' par_ID.iloc - line = sublin(result,8) - lmin = subwrd(line,4) - lmax = subwrd(line,5) - if ( lmin < fmin) ; fmin = lmin ; endif - if ( lmax > fmax) ; fmax = lmax ; endif -* -* say result -* say fmin ' ' fmax ' ' lmin ' ' lmax -* - iloc = iloc + 1 -* - endwhile -* - itime = itime + 1 -* - endwhile -* - if ( -fmin > fmax ) - sscl = -fmin - else - sscl = fmax - endif -* - say ' ' - say 'Done, min and max are ' fmin ' and ' fmax ' (' sscl ')' -* -* Generic page setup - - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say 'Setting up the page ...' -* - st1 = '' - st2 = '' - st3 = '' - st4 = '' -* - sst = '???' - if (ilev=1); sst='F'; endif; - if (ilev=2); sst='Sin'; endif; - if (ilev=3); sst='Snl'; endif; - if (ilev=4); sst='Sds'; endif; - if (ilev=5); sst='Sbt'; endif; - if (ilev=6); sst='Stot'; endif; -* - if ( nloc = 1 ) - ntest = ntime - itype = 0 - say ' Single location, location ID in header.' - else - ntest = nloc - itype = 1 - say ' Multiple locations, time ID in header.' - endif -* - if ( ntest = 1 ) - npan = 1 - else - if ( ntest <= 4 ) - npan = 4 - else - npan = 6 - endif - endif - say ' Putting ' npan ' panels on a page.' -* -* settings for 1 panel ... -* - if ( npan = 1 ) -* - xtc = 0.5 * xmax - yt1 = 9.1 - yt2 = 1.8 - yt3 = 2.0 - size1 = 0.25 - size2 = 0.12 - size3 = 0.12 - nc = 50 -* - pw = 6. - sx = 0. - sy = 0. - xp0 = 0.5 * ( xmax - pw ) - yp0 = 0.5 * ( ymax - pw ) -* - endif -* -* settings for 4 panel ... -* - if ( npan = 4 ) -* - xtc = 0.5 * xmax - yt1 = 10.0 - yt2 = 1.0 - yt3 = 1.2 - size1 = 0.22 - size2 = 0.12 - size3 = 0.12 - nc = 35 -* - pw = 3.6 - sx = 0.2 - sy = 0.5 - xp0 = 0.5 * ( xmax - sx ) - pw - yp0 = 0.5 * ( ymax + sy ) -* - endif -* -* settings for 6 panel ... -* - if ( npan = 6 ) -* - xtc = 0.5 * xmax - yt1 = 10.7 - yt2 = 0.2 - yt3 = 0.4 - size1 = 0.20 - size2 = 0.12 - size3 = 0.12 - nc = 35 -* - pw = 3.0 - sx = 0.2 - sy = 0.3 - xp0 = 0.5 * ( xmax - sx ) - pw - yp0 = 7.3 -* - endif -* -* Actual plotting loop - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say 'Starting actual plotting ...' -* - ipage = 0 - ipan = 1 - xp = xp0 - yp = yp0 -* - i = 1 - while ( i <= ntime ) - 'set t ' i -* - j = 1 - while ( j <= nloc ) -* -* ... new page ... -* - if ( ipan = 1 ) -* - ipage = ipage + 1 - say ' Starting with page ' ipage -* - if ( ipage > 1 ) - iplot = ipage - 1 - 'printim 'sst'_plot_'iplot'.png' - 'clear' - endif -* - page_ID = sst ' for ' - if ( itype = 0 ) - page_ID = page_ID loc_ID.j - else - page_ID = page_ID showtime (i) - endif - 'set string 1 c 5' - 'set strsiz ' size1 - 'draw string ' xtc ' ' yt1 ' ' page_ID - 'set strsiz ' size2 - 'draw string ' xtc ' ' yt2 ' ' grid_ID - 'set strsiz ' size3 - 'draw string ' xtc ' ' yt3 ' ' center_ID -* - endif -* -* ... plot spectrum ... -* - if ( itype = 0 ) - st1 = showtime(i) - else - st1 = loc_ID.j - endif -* - if ( hs.j.i < 10 ) - st2 = 'Hs = ' hs.j.i 'm' - else - st2 = 'Hs = ' hs.j.i 'm' - endif -* - if ( npan < 6 ) -* - if ( ua.j.i < 10 ) - st3 = 'U = ' ua.j.i 'm/s' - else - st3 = 'U = ' ua.j.i 'm/s' - endif -* - if ( ca.j.i < 0.1 ) - st4 = '' - else - st4 = 'C = ' ca.j.i 'm/s' - endif -* - endif -* - if ( ilev = 1 ) - if ( polar = 'yes' ) - dummy = plotspec (xp,yp,pw,dth,dfr,fmx,par_ID.j,fmax,st1,st2,st3,st4,nc,ua.j.i,ux.j.i,uy.j.i,ca.j.i,cx.j.i,cy.j.i,color) - else - dummy = plotspec_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,fmax,st1,st2,st3,st4,nc,ua.j.i,ux.j.i,uy.j.i,ca.j.i,cx.j.i,cy.j.i,color) - endif - else - if ( polar = 'yes' ) - dummy = plotsrce (xp,yp,pw,dth,dfr,fmx,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - else - dummy = plotsrce_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - endif - endif -* -* ... update panel counter ... -* - ipan = ipan + 1 - xp = xp + pw + sx - if ( xp + pw > xmax ) - xp = xp0 - yp = yp - pw - sy - endif - if ( ipan > npan ) - ipan = 1 - xp = xp0 - yp = yp0 - endif -* - j = j + 1 - endwhile -* - if ( nloc > 1 ) - ipan = 1 - xp = xp0 - yp = yp0 - endif -* - i = i + 1 - endwhile -* -* End of operations - - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say '-------------------------' - say '*** End of 1source.gs ***' - say '-------------------------' - say ' ' - 'quit' -* -* End of main script - - - - - - - - - - - - - - - - - - - - - - - -* -* ------------------------------------------------------------------------------ - function plotspec (xp0,yp0,dxyp,dxgrid,dygrid,ymax,spec,scale,str1,str2,str3,str4,strlen,u,ux,uy,c,cx,cy,color) -* -* Function to plot a spectrum at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* dxgrid Grid line increment for directions. -* dygrid Grid line increment for frequencies. -* ymax Maximum frequency. -* spec Spectrum to be plotted. -* scale Scale (division) factor for spectrum. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* ux/y Wind speed and components. -* cx/y Current speed and components. -* color color of b&w [yes/---] -* -* 0. Initializations -* - 'set grads off' - 'set lon -180 180' - 'set lat ' 90-ymax ' 90' -* -* 1. Set up plot location -* - 'set parea ' xp0 ' ' xp0+dxyp ' ' yp0 ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 17 - factor = 2 - level=1.001 - levels='' -* - while ( i > 0 ) - level = level / factor - levels = level ' ' levels - i = i - 1 - endwhile -* -* 3. Plot spectrum -* - 'set mproj nps' - 'set grid off' -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' - 'd ' spec'/'scale - cblack = 1 - current = 65 - wind = 64 - else - cblack = 3 - current = 66 - wind = 63 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 4. Plot grid lines manually to avoid bug -* - 'set line 66 1 3' - if ( color = 'yes' ) - 'set line 66 5 3' - endif -* - x = 0 - while ( x < 360+0.1*dxgrid ) - 'q ll2xy 'x' '90.-dygrid - x1 = subwrd(result,1) - y1 = subwrd(result,2) - 'q ll2xy 'x' '90.-ymax - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - x = x + dxgrid - endwhile -* - dx = 5 - y = dygrid - while ( y < ymax + 0.1*dygrid ) - x = 0 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - while ( x < 360 ) - x = x+dx - x1 = x2 - y1 = y2 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - endwhile - y = y + dygrid - endwhile -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 5. Plot current and wind vector -* - xc = xp0 + 0.5*dxyp - yc = yp0 + 0.5*dxyp -* -* 5.a current -* - 'set line ' current ' 1 6' -* - cmax = 1.5 - cmin = 0.1 - if ( c > cmin ) - if ( c < cmax ) - dc = 0.375 * (dygrid/ymax) * dxyp * c / cmax - else - dc = 0.375 * (dygrid/ymax) * dxyp - endif - dcx = dc * cx / c - dcy = dc * cy / c - x2 = xc - dcx - y2 = yc - dcy - x1 = xc + dcx - y1 = yc + dcy -* -* 'draw line ' x2 ' ' y2 ' ' x1 ' ' y1 -* - 'q xy2w 'x1' 'y1 - lon = subwrd(result,3) - lat = subwrd(result,6) - lonh = lon + 10 - lath = 90. - 0.75*(90.-lat) - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 - lonh = lon - 10 - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 -* - endif -* -* 5.b wind -* - 'set line ' wind ' 1 6' -* - umax = 20. - umin = 2.5 - if ( u > umin ) - if ( u < umax ) - du = 0.375 * (dygrid/ymax) * dxyp * u / umax - else - du = 0.375 * (dygrid/ymax) * dxyp - endif - dux = du * ux / u - duy = du * uy / u - x2 = xc - dux - y2 = yc - duy - x1 = xc + dux - y1 = yc + duy -* - 'draw line ' x2 ' ' y2 ' ' x1 ' ' y1 -* - 'q xy2w 'x1' 'y1 - lon = subwrd(result,3) - lat = subwrd(result,6) - lonh = lon + 10 - lath = 90. - 0.75*(90.-lat) - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 - lonh = lon - 10 - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 -* - endif -* -* 6. ID text around spectrum -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl' - 'draw string ' xp0 ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl' - 'draw string ' xp0 ' ' yp0 -0.75*size ' ' str4 - endif -* - return -* ------------------------------------------------------------------------------ - function plotsrce (xp0,yp0,dxyp,dxgrid,dygrid,ymax,source,scale,str1,str2,str3,str4,strlen,color) -* -* Function to plot a source term at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* dxgrid Grid line increment for directions. -* dygrid Grid line increment for frequencies. -* ymax Maximum frequency. -* source Source term to be plotted. -* scale Scale (division) factor for source term. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* color color of b&w [yes/---] -* -* 0. Initializations -* - 'set grads off' - 'set lon -180 180' - 'set lat ' 90-ymax ' 90' -* -* 1. Set up plot location -* - 'set parea ' xp0 ' ' xp0+dxyp ' ' yp0 ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 7 - factor = 2 - levelp = 1.001 - leveln = -1.001 - levpos = '' - levneg = '' -* - while ( i > 0 ) - levelp = levelp / factor - leveln = leveln / factor - levpos = levelp ' ' levpos - levneg = levneg ' ' leveln - i = i - 1 - endwhile - levels = levneg ' 0 ' levpos -* -* 3. Plot source term -* - 'set mproj nps' - 'set grid off' -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56' -* 'set ccols 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41' - 'd ' source'/'scale - cblack = 1 - stpos = 1 - stneg = 1 - else - cblack = 3 - stpos = 1 - stneg = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stpos - 'set clevs ' levpos - 'd ' source'/'scale -* -* 4. Plot grid lines manually to avoid bug -* - if ( color = 'yes' ) - 'set line 66 5 3' - else - 'set line 66 1 3' - endif -* - x = 0 - while ( x < 360+0.1*dxgrid ) - 'q ll2xy 'x' '90.-dygrid - x1 = subwrd(result,1) - y1 = subwrd(result,2) - 'q ll2xy 'x' '90.-ymax - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - x = x + dxgrid - endwhile -* - dx = 5 - y = dygrid - while ( y < ymax + 0.1*dygrid ) - x = 0 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - while ( x < 360 ) - x = x+dx - x1 = x2 - y1 = y2 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - endwhile - y = y + dygrid - endwhile -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stpos - 'set clevs ' levpos - 'd ' source'/'scale - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stneg - 'set clevs ' levneg - 'd ' source'/'scale -* -* 5. ID text around source term -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl' - 'draw string ' xp0 ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl' - 'draw string ' xp0 ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function plotspec_c (xp0,yp0,dxyp,xoff,dx,ymin,ymax,dy,spec,scale,str1,str2,str3,str4,strlen,u,ux,uy,c,cx,cy,color) -* -* Function to plot a spectrum at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* xoff Shift of first frequency (if 0, axis from 0-360 cartesian) -* dx Directional increment (axis). -* ymin Minimum frequency. -* ymax Maximum frequency. -* dy Frequency increment (axis). -* spec Spectrum to be plotted. -* scale Scale (division) factor for spectrum. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* ux/y Wind speed and components. -* cx/y Current speed and components. -* -* 0. Initializations -* - 'set grads off' - 'set lon ' xoff-270 ' ' xoff+90 - 'set lat ' 90-ymax ' ' 90-ymin -* -* 1. Set up plot location -* - 'set parea ' xp0+0.07*dxyp ' ' xp0+dxyp ' ' yp0+0.05*dxyp ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 15 - factor = 2 - level=1.001 - levels='' -* - while ( i > 0 ) - level = level / factor - levels = level ' ' levels - i = i - 1 - endwhile -* -* 3. Plot spectrum -* - 'set mproj scaled' - 'set xyrev on' - 'set xflip on' - 'set grid off' - 'set xlab off' - 'set ylab off' - labsize = dxyp / strlen / 1.25 - 'set ylopts 1 4 ' labsize - 'set ylint ' dx - 'set xlint ' dy -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' - 'd ' spec'/'scale - cblack = 1 - else - cblack = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 4. Plot axes manually -* - freq = 0. - 'set line 1 1 4' - 'set string 1 c 4' - 'set strsiz ' labsize -* - while ( freq <= ymax ) - if ( freq >= ymin ) - xt = xp0 + 0.07*dxyp + 0.93*dxyp * ( freq - ymin ) / ( ymax - ymin ) - 'draw line ' xt ' ' yp0+1.5*labsize ' ' xt ' ' yp0 + 0.05*dxyp - 'draw string ' xt ' ' yp0+0.5*labsize ' ' freq - endif - freq = freq + dy - endwhile -* - thmin = xoff - thmax = xoff + 360. - th = 0. -* - while ( th > thmin ) - th = th - dx - endwhile -* - 'set string 1 r 4' - while ( th <= thmax ) - if ( th >= thmin ) - yt = yp0 + 0.05*dxyp + 0.95*dxyp * ( th - thmin ) / ( thmax - thmin ) - 'draw line ' xp0+0.07*dxyp ' ' yt ' ' xp0+0.07*dxyp-0.5*labsize ' ' yt - 'draw string ' xp0+0.07*dxyp-1.0*labsize ' ' yt ' ' th - endif - th = th + dx - endwhile -* -* 5. Plot current and wind vector -* -* -* 6. ID text around spectrum -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function plotsrce_c (xp0,yp0,dxyp,xoff,dx,ymin,ymax,dy,source,scale,str1,str2,str3,str4,strlen,color) -* -* Function to plot a source term at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* xoff Shift of first frequency (if 0, axis from 0-360 cartesian) -* dx Directional increment (axis). -* ymin Minimum frequency. -* ymax Maximum frequency. -* dy Frequency increment (axis). -* source Source term to be plotted. -* scale Scale (division) factor for source term. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* -* 0. Initializations -* - 'set grads off' - 'set lon ' xoff-270 ' ' xoff+90 - 'set lat ' 90-ymax ' ' 90-ymin -* -* 1. Set up plot location -* - 'set parea ' xp0+0.07*dxyp ' ' xp0+dxyp ' ' yp0+0.05*dxyp ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 7 - factor = 2 - levelp = 1.001 - leveln = -1.001 - levpos = '' - levneg = '' -* - while ( i > 0 ) - levelp = levelp / factor - leveln = leveln / factor - levpos = levelp ' ' levpos - levneg = levneg ' ' leveln - i = i - 1 - endwhile - levels = levneg ' 0 ' levpos -* -* 3. Plot source term -* - 'set mproj scaled' - 'set xyrev on' - 'set xflip on' - 'set grid off' - 'set xlab off' - 'set ylab off' - labsize = dxyp / strlen / 1.25 - 'set ylopts 1 4 ' labsize - 'set ylint ' dx - 'set xlint ' dy -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56' -* 'set ccols 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41' - 'd ' source'/'scale - cblack = 1 - stpos = 1 - stneg = 1 - else - cblack = 3 - stpos = 1 - stneg = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stpos - 'set clevs ' levpos - 'd ' source'/'scale - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stneg - 'set clevs ' levneg - 'd ' source'/'scale -* -* 4. Plot axes manually -* - freq = 0. - 'set line 1 1 4' - 'set string 1 c 4' - 'set strsiz ' labsize -* - while ( freq <= ymax ) - if ( freq >= ymin ) - xt = xp0 + 0.07*dxyp + 0.93*dxyp * ( freq - ymin ) / ( ymax - ymin ) - 'draw line ' xt ' ' yp0+1.5*labsize ' ' xt ' ' yp0 + 0.05*dxyp - 'draw string ' xt ' ' yp0+0.5*labsize ' ' freq - endif - freq = freq + dy - endwhile -* - thmin = xoff - thmax = xoff + 360. - th = 0. -* - while ( th > thmin ) - th = th - dx - endwhile -* - 'set string 1 r 4' - while ( th <= thmax ) - if ( th >= thmin ) - yt = yp0 + 0.05*dxyp + 0.95*dxyp * ( th - thmin ) / ( thmax - thmin ) - 'draw line ' xp0+0.07*dxyp ' ' yt ' ' xp0+0.07*dxyp-0.5*labsize ' ' yt - 'draw string ' xp0+0.07*dxyp-1.0*labsize ' ' yt ' ' th - endif - th = th + dx - endwhile -* -* 5. ID text around source term -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* -* if ( str4 != '' ) -* 'set string 1 tl 4' -* 'draw string ' xp0+0.07*dxyp ' ' yp0 -0.75*size ' ' str4 -* endif -* - return - -* ------------------------------------------------------------------------------ - function showtime (itime) -* -* Get date and time in preferred format -* -* Parameter list : -* -* itime Discrete time counter -* - 'set t ' itime - 'query time' - gradsdate = subwrd(result,3) - test = substr ( gradsdate, 3, 1 ) - if ( test='Z' ) - year = substr ( gradsdate, 9, 4 ) - mnth = substr ( gradsdate, 6, 3 ) - day = substr ( gradsdate, 4, 2 ) - hour = substr ( gradsdate, 1, 2 ) - min = '00' - else - year = substr ( gradsdate, 12, 4 ) - mnth = substr ( gradsdate, 9, 3 ) - day = substr ( gradsdate, 7, 2 ) - hour = substr ( gradsdate, 1, 2 ) - min = substr ( gradsdate, 4, 2 ) - endif - - month= '??' - if (mnth='JAN'); month= '01'; endif; - if (mnth='FEB'); month= '02'; endif; - if (mnth='MAR'); month= '03'; endif; - if (mnth='APR'); month= '04'; endif; - if (mnth='MAY'); month= '05'; endif; - if (mnth='JUN'); month= '06'; endif; - if (mnth='JUL'); month= '07'; endif; - if (mnth='AUG'); month= '08'; endif; - if (mnth='SEP'); month= '09'; endif; - if (mnth='OCT'); month= '10'; endif; - if (mnth='NOV'); month= '11'; endif; - if (mnth='DEC'); month= '12'; endif; - - if ( test='Z' ) - vdate = year '/' month '/' day ' ' hour 'z' - else - vdate = year '/' month '/' day ' ' hour ':' min 'z' - endif -* - return vdate diff --git a/model/aux/cbarn.gs b/model/aux/cbarn.gs deleted file mode 100644 index 33bc8dfef..000000000 --- a/model/aux/cbarn.gs +++ /dev/null @@ -1,241 +0,0 @@ -* -* Script to plot a colorbar -* -* The script will assume a colorbar is wanted even if there is -* not room -- it will plot on the side or the bottom if there is -* room in either place, otherwise it will plot along the bottom and -* overlay labels there if any. This can be dealt with via -* the 'set parea' command. In version 2 the default parea will -* be changed, but we want to guarantee upward compatibility in -* sub-releases. -* -* -* modifications by mike fiorino 940614 -* -* - the extreme colors are plotted as triangles -* - the colors are boxed in white -* - input arguments in during a run execution: -* -* run cbarn sf vert xmid ymid -* -* sf - scale the whole bar 1.0 = original 0.5 half the size, etc. -* vert - 0 FORCES a horizontal bar = 1 a vertical bar -* xmid - the x position on the virtual page the center the bar -* ymid - the x position on the virtual page the center the bar -* -* if vert,xmid,ymid are not specified, they are selected -* as in the original algorithm -* - -function colorbar (args) - -sf=subwrd(args,1) -vert=subwrd(args,2) -xmid=subwrd(args,3) -ymid=subwrd(args,4) - -if(sf='');sf=1.0;endif - -* -* Check shading information -* - 'query shades' - shdinfo = result - if (subwrd(shdinfo,1)='None') - say 'Cannot plot color bar: No shading information' - return - endif - -* -* Get plot size info -* - 'query gxinfo' - rec2 = sublin(result,2) - rec3 = sublin(result,3) - rec4 = sublin(result,4) - xsiz = subwrd(rec2,4) - ysiz = subwrd(rec2,6) - ylo = subwrd(rec4,4) - xhi = subwrd(rec3,6) - xd = xsiz - xhi - - ylolim=0.6*sf - xdlim1=1.0*sf - xdlim2=1.5*sf - barsf=0.8*sf - yoffset=0.2*sf - stroff=0.05*sf - strxsiz=0.12*sf - strysiz=0.13*sf -* -* Decide if horizontal or vertical color bar -* and set up constants. -* - if (yloxdlim1) - vchk = 1 - if(vert = 0) ; vchk = 0 ; endif - else - vchk = 0 - if(vert = 1) ; vchk = 1 ; endif - endif -* -* vertical bar -* - - if (vchk = 1 ) - - if(xmid = '') ; xmid = xhi+xd/2 ; endif - xwid = 0.2*sf - ywid = 0.5*sf - - xl = xmid-xwid/2 - xr = xl + xwid - if (ywid*cnum > ysiz*barsf) - ywid = ysiz*barsf/cnum - endif - if(ymid = '') ; ymid = ysiz/2 ; endif - yb = ymid - ywid*cnum/2 - 'set string 1 l 5' - vert = 1 - - else - -* -* horizontal bar -* - - ywid = 0.4 - xwid = 0.8 - - if(ymid = '') ; ymid = ylo/2-ywid/2 ; endif - yt = ymid + yoffset - yb = ymid - if(xmid = '') ; xmid = xsiz/2 ; endif - if (xwid*cnum > xsiz*barsf) - xwid = xsiz*barsf/cnum - endif - xl = xmid - xwid*cnum/2 - 'set string 1 tc 5' - vert = 0 - endif - - -* -* Plot colorbar -* - - - 'set strsiz 'strxsiz' 'strysiz - num = 0 - while (num triangle lookup table - ;****************************************************** - GPTRI=INTARR(ntri+1,5) - GPTRI(*,0:3)=TRIGP - GPTRI(*,4)=TRANSPOSE(FINDGEN(ntri+1)) - ; sort on index of first vertex - I1=LONARR(ntri+1) - I1(*)=(GPTRI(*,1)*NTRI+GPTRI(*,2))*NTRI+GPTRI(*,3) - SO=SORT(I1) - TEMPO=GPTRI - GPTRI=GPTRI(SO,*) - ;FOR I=1,NTRI DO PRINT,TRANSPOSE(GPTRI(I,*)) - ;ntrinei=taillelist(1)-nboundary-nngp-1 - ;print,'ntrinei 1',ntrinei,taillelist(1),nngp,'##',SIZE(boundary) - ntrinei=ntri*15 ;(ntrinei/2-nboundary)*2*4 - ntrinei=ntri+1+ntrinei - TRINEI=INTARR(ntrinei+1) - index=ntri+2 - II=INTARR(4) - TRINEI(1)=index - FOR I=1,ntri DO BEGIN - TRINEI(I+1)=TRINEI(I) - tempo=INTARR(ntri) - nindex=0 - FOR J=1,3 DO BEGIN - GPC=TRIGP(I,J) - IF GPC EQ GPNEI(GPNEI(GPC)) THEN K1=GPNEI(GPC)+1 ELSE K1=GPNEI(GPC) - K2=GPNEI(GPC+1)-1 - ;IF I GE 755 THEN PRINT,I,J,'GPC:',GPC,'NEI:',GPNEI(K1:K2) - FOR K=K1,K2 DO BEGIN - II(1)=GPC - II(2)=GPNEI(K) - IF K LT K2 THEN II(3)=GPNEI(K+1) ELSE $ - IF GPC NE GPNEI(GPNEI(GPC)) THEN II(3)=GPNEI(K1) $ - ELSE II(3)=GPNEI(K-1) - SO=SORT(II) - II=II(SO) - ;PRINT,'II',II(1:3) - IMIN=1 - IMAX=NTRI - IND3=(II(1)*NTRI+II(2))*NTRI+II(3) - IGUESS=(NTRI*II(1))/NNGP - INDG=(GPTRI(IGUESS,1)*NTRI+GPTRI(IGUESS,2))*NTRI+GPTRI(IGUESS,3) - WHILE (INDG NE IND3) AND (IMIN NE IMAX) DO BEGIN - IF INDG LT IND3 THEN BEGIN - IMIN=IGUESS - IGUESS=(IMIN+IMAX)/2 - IF IGUESS EQ IMIN THEN IGUESS=IMAX - ENDIF ELSE BEGIN - IMAX=IGUESS - IGUESS=(IMIN+IMAX)/2 - ENDELSE - INDG=(GPTRI(IGUESS,1)*NTRI+GPTRI(IGUESS,2))*NTRI+GPTRI(IGUESS,3) - ENDWHILE - found=0 - FOR L=TRINEI(I),TRINEI(I+1)-1 DO $ - IF TRINEI(L) EQ GPTRI(IGUESS,4) THEN found=1 - IF found EQ 0 AND I NE GPTRI(IGUESS,4) THEN BEGIN - TRINEI(TRINEI(I+1))=GPTRI(IGUESS,4) - TRINEI(I+1)=TRINEI(I+1)+1 - ENDIF - ENDFOR - ENDFOR - ;print,I,' neighbors:',TRINEI(TRINEI(I):TRINEI(I+1)-1) - ENDFOR - ntrinei=TRINEI(ntri+1)-1 - tempo=TRINEI - TRINEI=INTARR(ntrinei+1) - TRINEI(1:ntrinei)=TEMPO(1:ntrinei) - PRINT,'ntrinei',ntrinei,'nei..',TEMPO(ntrinei),TEMPO(ntrinei+1) - datastatus(18)=1 - END - 'Save tri':BEGIN ;write grid file - file=DIALOG_PICKFILE(/READ, FILTER = '*.log') - IF file NE '' THEN BEGIN - GET_LUN,unit - OPENW,unit,file - PRINTF,unit,ntri,' Number of triangles' - IZONE=5 - FOR I=1,ntri DO BEGIN - PRINTF,unit,I,TRANSPOSE(TRIGP(I,0:3)) - ENDFOR - - ntrinei=TRINEI(ntri+1)-1 - PRINTF,unit,ntri,ntrinei,' Size of neighbor array' - PRINTF,unit,trinei(1:ntri+1) - FOR I=1,ntri DO BEGIN - ;PRINT,I,trinei(trinei(I):trinei(I+1)-1) - PRINTF,unit,trinei(trinei(I):trinei(I+1)-1) - ENDFOR - - zones=INTARR(ntri+1) - zones(*)=TRIGP(0:ntri,0) - SO=(SORT(zones)) - zones2=INDGEN(ntri+1) - zones2=zones2(SO) - zones=zones(SO) - - zonetri=INTARR(nzone+2+ntri) - ZC=1 - ZONETRI(1)=nzone+2 - ZT=1 - ZZ=1 - FOR I=2,ntri DO BEGIN - IF zones(I) NE ZC THEN BEGIN - ZONETRI(ZC+1)=ZONETRI(ZC)+ZT - temp=zones2(ZZ:ZZ+ZT-1) - ZONETRI(ZONETRI(ZC):ZONETRI(ZC+1)-1)=temp(SORT(temp)) - ZZ=ZZ+ZT - ZT=0 - ZC=ZC+1 - ENDIF - ZT=ZT+1 - ENDFOR - ZONETRI(nzone+1)=NZONE+NTRI+2 - temp=zones2(ZZ:ZZ+ZT-1) - ZONETRI(ZONETRI(nzone):ZONETRI(nzone+1)-1)=temp(SORT(temp)) - - nzonetri=ZONETRI(nzone+1)-1 - PRINTF,unit,nzone,nzonetri,' Size of Zone->triangle array' - PRINTF,unit,ZONETRI(1:nzone+1) - FOR I=1,nzone DO BEGIN - PRINTF,unit,ZONETRI(ZONETRI(I):ZONETRI(I+1)-1) - ENDFOR - - - ZONEGP=INTARR(nzone+2+NTRI*3) - - index=nzone+2 - ZONEGP(1)=index - FOR I=1,nzone DO BEGIN - ZONEGP(I+1)=ZONEGP(I) - FOR J=ZONETRI(I),ZONETRI(I+1)-1 DO BEGIN - TRIC=ZONETRI(J) - FOR K=1,3 DO BEGIN - GPC=TRIGP(TRIC,K) - found=0 - FOR L=ZONEGP(I),ZONEGP(I+1)-1 DO $ - IF ZONEGP(L) EQ GPC THEN found=1 - IF found EQ 0 THEN BEGIN - ZONEGP(ZONEGP(I+1))=GPC - ZONEGP(I+1)=ZONEGP(I+1)+1 - ENDIF - ENDFOR - ENDFOR - ENDFOR - nzonegp=ZONEGP(nzone+1) - tempo=ZONEGP - ZONETRI=INTARR(nZONEGP) - ZONETRI=tempo(0:nZONEGP-1) - FOR I=1,nzone DO BEGIN - temp=ZONEGP(ZONEGP(I):ZONEGP(I+1)-1) - ZONEGP(ZONEGP(I):ZONEGP(I+1)-1)=temp(SORT(temp)) - ENDFOR - - nzonegp=ZONEGP(nzone+1)-1 - PRINTF,unit,nzone,nzonegp,' Size of Zone->GP array' - PRINTF,unit,ZONEGP(1:nzone+1) - FOR I=1,nzone DO BEGIN - PRINTF,unit,ZONEGP(ZONEGP(I):ZONEGP(I+1)-1) - ENDFOR - - GPZONE=INTARR(nngp*4) - - index=nngp+2 - GPZONE(1:nngp+1)=index - FOR I=1,nzone DO BEGIN - FOR J=ZONEGP(I),ZONEGP(I+1)-1 DO BEGIN - GPC=ZONEGP(J) - IF GPZONE(NNGP+1) GT GPZONE(GPC) THEN $ - GPZONE(GPZONE(GPC)+1:GPZONE(NNGP+1))=GPZONE(GPZONE(GPC):GPZONE(NNGP+1)-1) - GPZONE(GPC+1:NNGP+1)=GPZONE(GPC+1:NNGP+1)+1 - GPZONE(GPZONE(GPC))=I - ENDFOR - ENDFOR - ngpzone=GPZONE(nngp+1)-1 - PRINTF,unit,nngp,ngpzone,' Size of GP->zone array' - PRINTF,unit,GPZONE(1:nngp+1) - FOR I=1,nngp DO BEGIN - PRINTF,unit,I,GPZONE(GPZONE(I):GPZONE(I+1)-1) - ENDFOR - - CLOSE,unit - FREE_LUN,unit - ENDIF - END - - ENDCASE - END - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE ev.id of - WBathy(1,2):bathy_line=FLOAT(value(0)) - WBathy(2,2):bathy_ker_size=FLOAT(value(0)) - ENDCASE - END - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WBathy(6,1): BEGIN - showdot1=ev.index - adbathydot=showdot1+showdot2 - END - WBathy(6,2): BEGIN - showdot2=ev.index - adbathydot=showdot1+showdot2 - END - ENDCASE - END - ENDCASE -RETURN -END - - -;---------------------------------------------------------------------------- -PRO bathytool_draw_event,ev -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON FILES, filestatus,datastatus,paths,filters,filenames,nposo -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON BATHYTOOL, bathy_ker_size,bathy_line,bathytool_click -COMMON WBat,Wbathy,rootbtool -COMMON LOCAL_bathytool,coordP,coordR -;*******END OF COMMON BLOCKS******************************* - CASE ev.type OF ;case loop on action types - 0:BEGIN ;ev.type=0 : click (button pushed down) - coordP=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - coordP(0)=MIN([MAX([0.,coordP(0)]),(nx-1)*dx]) - coordP(1)=MIN([MAX([0.,coordP(1)]),(ny-1)*dy]) - END - 1:BEGIN ;ev.type=1 button release - coordR=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - coordR(0)=MIN([MAX([0.,coordR(0)]),(nx-1)*dx]) - coordR(1)=MIN([MAX([0.,coordR(1)]),(ny-1)*dy]) - CASE bathytool_click OF - 0:BEGIN ;draw lines - IF datastatus(3) EQ 1 THEN BEGIN - i1=ROUND(coordP(0)/dx) - j1=FLOOR(coordP(1)/dy) - i2=ROUND(coordR(0)/dx) - j2=FLOOR(coordR(1)/dy) - nii=max([abs(j2-j1),abs(i2-i1)])+1 - ddx=(coordR(0)/dx-coordP(0)/dx)/max([(nii-1),1]) - ddy=(coordR(1)/dy-coordP(1)/dy)/max([(nii-1),1]) - FOR ii=0,nii DO BEGIN - i3=ROUND(coordP(0)/dx+ddx*ii) - j3=ROUND(coordP(1)/dy+ddy*ii) - gd(i3,j3)=bathy_line - ENDFOR - ENDIF - END - ELSE: - ENDCASE - END - - ; Updates the cursor position and value of the current field - 2:IF datastatus (2) THEN BEGIN ;ev.type=2 when the cursor is in - ;in the drawing window - coord=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - i0=FLOOR(coord(0)/dx) - j0=FLOOR(coord(1)/dy) - IF ((i0 GE 0) AND (i0 LT nx) $ - AND (j0 GE 0) AND (j0 LT ny) $ - AND datastatus(3)) THEN BEGIN - valeur=gd(i0,j0) - WIDGET_CONTROL,Wright(13,5), $ - SET_VALUE=STRING(valeur,FORMAT='(F8.2)') - ENDIF - WIDGET_CONTROL,Wright(13,1), $ - SET_VALUE=STRING(coord(0),FORMAT='(F7.3)') - WIDGET_CONTROL,Wright(13,3), $ - SET_VALUE=STRING(coord(1),FORMAT='(F6.2)') - latdeg=0. - latmin=0. - londeg=0. - lonmin=0. - latlonstring='' - XYtoLatLon,coord(0),coord(1), $ - latdeg,latmin,londeg,lonmin,latlonstring - WIDGET_CONTROL,Wright(14,1), $ - SET_VALUE=latlonstring - ENDIF - ELSE: - ENDCASE - -RETURN -END - -;---------------------------------------------------------------------------- -PRO plot_dot_bathy -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,filltype -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON BATHYDOT,ndotmax,ndot1,XDOT1,YDOT1,ZDOT1,ndot2,XDOT2,YDOT2,ZDOT2, $ - bathydot_path,showdot1,showdot2 - - zmin=1000. - zmax=0. - kount1=0 - kount2=0 - IF showdot1 THEN BEGIN - PLOTDOT1=INTARR(ndot1) - FOR I=0L,ndot1-1 DO BEGIN - IF (XDOT1(I) GE rangex(0) AND XDOT1(I) LE rangex(1) $ - AND YDOT1(I) GE rangey(0) AND YDOT1(I) LE rangey(1)) THEN BEGIN - PLOTDOT1(I)=1 - IF ZDOT1(I) GT zmax THEN zmax=ZDOT1(I) - IF ZDOT1(I) LT zmin THEN zmin=ZDOT1(I) - ENDIF - ENDFOR - Index1=WHERE(PLOTDOT1 EQ 1,Kount1) - ENDIF - IF showdot2 THEN BEGIN - PLOTDOT2=INTARR(ndot2) - FOR I=0L,ndot2-1 DO BEGIN - IF (XDOT2(I) GE rangex(0) AND XDOT2(I) LE rangex(1) $ - AND YDOT2(I) GE rangey(0) AND YDOT2(I) LE rangey(1)) THEN BEGIN - PLOTDOT2(I)=1 - IF ZDOT2(I) GT zmax THEN zmax=ZDOT2(I) - IF ZDOT2(I) LT zmin THEN zmin=ZDOT2(I) - ENDIF - ENDFOR - Index2=WHERE(PLOTDOT2 EQ 1,Kount2) - ENDIF - - c_numlev=Navailcolor-2 - MakeLevels,zmin,zmax - colorind=1+FINDGEN(navailcolor-3) - colorind=navailcolor-1-colorind - if cbar THEN ColorBar,lev,colorind,cbtit,1,5 - - PLOT,[rangex(0)],[rangey(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - IF (kount1 GT 0) THEN $ - A = FINDGEN(17) * (!PI*2/16.) ;Make a vector of 16 points, A[i] = 2pi/16. - USERSYM, COS(A), SIN(A), /FILL ;Define the symbol to be a filled circle - PLOTS,XDOT1(Index1),Ydot1(Index1),PSYM=8,SYMSIZE=0.1, $ - COLOR=1+(Navailcolor-3)*(zmax-ZDOT1(Index1))/(zmax-zmin) - IF (kount2 GT 0) THEN BEGIN - A = FINDGEN(17) * (!PI*2/16.) ;Make a vector of 16 points, A[i] = 2pi/16. - USERSYM, COS(A), SIN(A), /FILL ;Define the symbol to be a filled circle - PLOTS,XDOT2(Index2),Ydot2(Index2),PSYM=8,SYMSIZE=0.8, $ - COLOR=1+(Navailcolor-3)*(zmax-ZDOT2(Index2))/(zmax-zmin) - A = FINDGEN(17) * (!PI*2/16.) ;Make a vector of 16 points, A[i] = 2pi/16. - USERSYM, COS(A), SIN(A) ;Define the symbol to be a filled circle - PLOTS,XDOT2(Index2),Ydot2(Index2),PSYM=8,SYMSIZE=0.8 - ENDIF -RETURN -END - -;---------------------------------------------------------------------------- -PRO Smbat -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON BATHYTOOL, bathy_ker_size,bathy_line,bathytool_click - L=bathy_ker_size - I0=FIX(0.5+L/dx) - J0=FIX(0.5+L/dy) - print,'dx,dy',dx,dy,I0,J0 - window=FLTARR(401) - window(0:200)=HANNING(201) - window(200:400)=HANNING(201) - window(100:300)=1. - kernel=FLTARR(401,401) - FOR I=0,400 DO BEGIN - FOR J=0,400 DO BEGIN - Ind=FIX(SQRT(FLOAT(I-200)^2.+FLOAT(J-200)^2.)+0.5) - IF Ind LE 200 THEN $ - kernel(I,J)=window(200+Ind) - ENDFOR - ENDFOR - ker=CONGRID(kernel,I0,J0);,/MINUS_ONE) - ker=ker/TOTAL(ker) - surface,ker - tempo=gd - gd=CONVOL(tempo,ker,/CENTER,/EDGE_TRUNCATE) - Index=WHERE(tempo LT 0,kount) - IF kount GT 0 THEN gd(index)=tempo(index) - RETURN - END -;---------------------------------------------------------------------------- -PRO Fillgaps -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax - I0=4 - J0=4 - I1=0 - I2=2*I0 - J1=0 - J2=2*J0 - HOLES=GD GT 5000. - S = REPLICATE(1, 3, 3) - FOR I=0,nx-1 DO BEGIN - PRINT,'I:',I - FOR J=0,ny-1 DO IF HOLES(I,J) THEN BEGIN - ;PRINT,'I,J:',I,J - A=INTARR(2*I0+1,2*J0+1) - HOL=INTARR(2*I0+1,2*J0+1) - GDA=FLTARR(2*I0+1,2*J0+1) - I1=-MIN([I-I0,0]) - I2=2*I0+nx-1-MAX([I+I0,nx-1]) - J1=-MIN([J-J0,0]) - J2=2*I0+ny-1-MAX([J+J0,ny-1]) - - HOL(I1:I2,J1:J2)= $ - HOLES(MAX([I-I0,0]):MIN([I+I0,nx-1]),MAX([J-J0,0]):MIN([J+J0,ny-1])) - GDA(I1:I2,J1:J2)= $ - GD(MAX([I-I0,0]):MIN([I+I0,nx-1]),MAX([J-J0,0]):MIN([J+J0,ny-1])) - A(*,*)=0. - A(I0,J0)=1 - FOR K=1,I0 DO BEGIN - A=DILATE(A,S)*HOL - ENDFOR - BORDER=(DILATE(A,S)-A)*(1-HOL) - WEIGHT=0. - GD(I,J)=0. - FOR II=I1,I2 DO BEGIN - FOR JJ=J1,J2 DO BEGIN - IF BORDER(II,JJ) THEN BEGIN - GD(I,J)=GD(I,J)+GDA(II,JJ)*EXP(-((II-I0)^2+(JJ-J0)^2)/8) - WEIGHT=WEIGHT+EXP(-((II-I0)^2+(JJ-J0)^2)/8) - ENDIF - ENDFOR - ENDFOR - ;PRINT,'BORDER:' - ;PRINT,BORDER(I1:I2,J1:J2) - IF WEIGHT NE 0. THEN GD(I,J)=GD(I,J)/WEIGHT ELSE GD(I,J)=1.E4 - ;PRINT,'GD:',GD(I,J) - ENDIF - ENDFOR - GET_LUN,unit - OPENW,unit,'/d/span11/ardhuin/MULTIBEAM/square2_filled.grd' - WRITEU,unit,transpose(gd) - CLOSE,unit - FREE_LUN,unit - RETURN - END diff --git a/model/aux/idl_twist/editspecials.pro b/model/aux/idl_twist/editspecials.pro deleted file mode 100755 index 99c9ad9d8..000000000 --- a/model/aux/idl_twist/editspecials.pro +++ /dev/null @@ -1,268 +0,0 @@ -PRO EditSpecials, anterior_root -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -;** 4 ** subwindow widgets widgets -COMMON WSE,WSpeceditor,WSEline1 -;*******END OF COMMON BLOCKS******************************* - - pbase=LONG(0) - vecbase=LONG(0) - Line1=LONG(0) - - - - pbase = WIDGET_BASE(TITLE='Special points editor', /COLUMN) - - XMENU, ['Insert point','Delete points','Import from file','Save with grid'],pbase, /ROW,$ - UVALUE=[0,1,2,3] - Wspeceditor= $ - WIDGET_TABLE(pbase, /EDITABLE, $ - - COLUMN_LABELS=['GP','X','Y','LAT','min','LON','min','color', $ - 'size','sym','thick','line','charsize'], $ - YSIZE=nspecgp,XSIZE=13, /RESIZEABLE_COLUMNS, $ - /SCROLL,Y_SCROLL_SIZE=10,X_SCROLL_SIZE=12, $ - COLUMN_WIDTHS=[40,80,80,40,80,40,80,40,40,40,40,40,40], $ - UNITS=0) - - - Line1=WIDGET_BASE(pbase, /FRAME, /ROW) - WSEline1=LONARR(4) - WSEline1(0)=WIDGET_LABEL(Line1,VALUE='Current point: ') - WSEline1(1)=WIDGET_SLIDER(Line1, MAXIMUM=nspecgp, MINIMUM=1) - WSEline1(2)=WIDGET_TEXT(Line1,/EDITABLE, value=specname(0)) - - - Line6 = WIDGET_BUTTON(pbase, VALUE='OK') - WIDGET_CONTROL, /REALIZE, pbase - XMANAGER, 'EditSpecials', pbase - Displayspec - subwin(5)=1 -RETURN -END - - -;---------------------------------------------------------------------------- -PRO EditSpecials_event, ev -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -;** 4 ** subwindow widgets widgets -COMMON WSE,WSpeceditor,WSEline1 -;*******END OF COMMON BLOCKS******************************* - - type = TAG_NAMES(ev, /STRUCTURE) - CASE type OF - 'WIDGET_BUTTON': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'OK': BEGIN - WIDGET_CONTROL, /DESTROY, ev.top - subwin(0)=0 - RETURN - END - 'Insert point': BEGIN - WIDGET_CONTROL,WSpeceditor,INSERT_ROWS=1 ;,/USE_TABLE_SELECT - nspecgp=nspecgp+1 - tempo=specmat - specmat=FLTARR(13,nspecgp) - specmat(*,0:nspecgp-2)=tempo(*,*) - tempo=specname - specname=STRARR(nspecgp) - specname(0:nspecgp-2)=tempo - WIDGET_CONTROL,WSEline1(1),SET_SLIDER_MAX=nspecgp - Displayspec - END - 'Delete points': BEGIN - selec=WIDGET_INFO(WSpeceditor,/TABLE_SELECT) - idel=selec(3)-selec(1)+1 - print,'selec',selec,'idel:',idel - WIDGET_CONTROL,WSpeceditor,/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,selec(1),11,selec(3)] - nspecgp=nspecgp-idel - tempo=specmat - specmat=FLTARR(13,nspecgp) - specmat(*,0:selec(1)-1)=tempo(*,0:selec(1)-1) - IF selec(1) LT nspecgp THEN specmat(*,selec(1):nspecgp-1)=tempo(*,selec(3)+1:nspecgp+idel-1) - tempo=specname - specname=STRARR(nspecgp) - specname(0:selec(1)-1)=tempo(0:selec(1)-1) - IF selec(1) LT nspecgp THEN specname(selec(1):nspecgp-1)=tempo(selec(3)+1:nspecgp+idel-1) - c_spec=0 - WIDGET_CONTROL,WSEline1(1),SET_SLIDER_MAX=nspecgp - WIDGET_CONTROL,WSEline1(2),SET_VALUE=specname(0) - END - 'Import from file': BEGIN - file=DIALOG_PICKFILE(/READ, FILTER = '../SHOWEX/*') - IF file NE '' THEN BEGIN - GET_LUN,unit - OPENR,unit,file - WHILE NOT EOF(unit) DO BEGIN - latdeg=0 - latmin=0. - londeg=0 - lonmin=0. - line=0 - name=' ' - READF,unit,latdeg,latmin,londeg,lonmin,line ;,name - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - nspecgp=nspecgp+1 - symbol=8. - IF line THEN symbol=-symbol - vecteur=[x,y,latdeg,latmin,londeg,lonmin,0.,0.2,symbol,1.,0.,1.] - tempo=specmat - specmat=FLTARR(13,nspecgp) - specmat(*,0:nspecgp-2)=tempo(*,*) - specmat(*,nspecgp-1)=vecteur - tempo=specname - specname=STRARR(nspecgp) - specname(0:nspecgp-2)=tempo(*) - ;specname(nspecgp-1)=name - ENDWHILE - WIDGET_CONTROL,WSEline1(1),SET_SLIDER_MAX=nspecgp - Displayspec - CLOSE,unit - FREE_LUN,unit - ENDIF - END - 'Save with grid':BEGIN ;write grid file - file=DIALOG_PICKFILE(/READ, FILTER = paths(5)+'*.grgp') - IF file NE '' THEN BEGIN - GET_LUN,unit - OPENW,unit,file - PRINTF,unit,nngp,' Number of grid points' - FOR I=1,(nngp) DO BEGIN - PRINTF,unit,I,gridmat(0:5,I-1), $ - FORMAT='(I6,2F9.4,I5,F9.4,I5,F9.4)' - ENDFOR - PRINTF,unit,nspecgp,' Number of special points (display)' - FOR I=0,(nspecgp-1) DO $ - PRINTF,unit,specmat(*,I),' ',specname(I), $ - FORMAT='(I6,2F9.4,I5,F9.4,I5,F9.4,I2,F4.1,3I3,F4.1,2a)' - CLOSE,unit - FREE_LUN,unit - ENDIF - END - ENDCASE - END - 'WIDGET_TABLE_CH': BEGIN - CASE (ev.id) OF - Wspeceditor:BEGIN - IF (ev.type LE 2) THEN BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value, $ - USE_TABLE_SELECT=[ev.x,ev.y,ev.x,ev.y] - specmat(ev.X,ev.Y)=value - IF ev.x LE 5 THEN UpdateSpectable,ev.X,ev.Y - ENDIF - END - ENDCASE - END - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE ev.id OF - WSEline1(2):BEGIN - specname(c_spec)=value(0) - END - ENDCASE - END - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WPline1(2) : c_repart=ev.index - ENDCASE - END - 'WIDGET_SLIDER': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - WSEline1(1): BEGIN - c_spec=FIX(value)-1 - WIDGET_CONTROL,WSEline1(2), SET_VALUE=specname(c_spec) - END - ENDCASE - END - ENDCASE -RETURN -END - -;---------------------------------------------------------------------------- -PRO UpdateSpecTable,I,J -;*******COMMON BLOCKS************************************** -;** 3 ** I/O and data variables -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -;** 4 ** subwindow widgets widgets -COMMON WSE,WSpeceditor,WSEline1 -;*******END OF COMMON BLOCKS******************************* - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - x=0. - y=0. - CASE 1 OF - (I LT 2):BEGIN ;updates the grid points latitudes and longitudes - XYtoLatLon,specmat(1,J),specmat(2,J),latdeg,latmin,londeg,lonmin - specmat(3,J)=latdeg - specmat(4,J)=latmin - specmat(5,J)=londeg - specmat(6,J)=lonmin - WIDGET_CONTROL, WSpeceditor, SET_VALUE=specmat(3:6,J:J), $ - USE_TABLE_SELECT=[3,J,6,J] - END - (I GE 2) AND (I LE 5):BEGIN ;updates the grid points X and Y coordinates - LatLontoxy,specmat(3,J),specmat(4,J),specmat(5,J),specmat(6,J),x,y - specmat(1,J)=x - specmat(2,J)=y - WIDGET_CONTROL, WSpeceditor, SET_VALUE=specmat(1:2,J:J), $ - USE_TABLE_SELECT=[1,J,2,J] - END - ENDCASE -END - -;---------------------------------------------------------------------------- -PRO Displayspec -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -;** 4 ** subwindow widgets widgets -COMMON WSE,WSpeceditor,WSEline1 -;*******END OF COMMON BLOCKS******************************* - WIDGET_CONTROL,WSpeceditor,TABLE_YSIZE=nspecgp - WIDGET_CONTROL,USE_TABLE_SELECT=[-1,-1,12,nspecgp-1] - ROWLAB=STRARR(nspecgp) - ROWLAB=STRCOMPRESS(STRING(FINDGEN(nspecgp)+1,FORMAT='(I3)')) - gridf=STRARR(13,nngp) - gridf(0,*)='(I6)' - gridf(1:2,*)='(F8.4)' - gridf(3,*)='(I4)' - gridf(4,*)='(F5.2)' - gridf(5,*)='(I4)' - gridf(6,*)='(F6.2)' - gridf(7,*)='(I3)' - gridf(8,*)='(F4.2)' - gridf(9,*)='(I2)' - gridf(10,*)='(F4.2)' - gridf(11,*)='(I2)' - gridf(12,*)='(F4.2)' - ; COLUMN_LABELS=['GP','X','Y','LAT','min','LON','min','color', $ - ; 'size','sym','thick','line','charsize'], $ - - WIDGET_CONTROL,WSpeceditor,FORMAT=gridf,ROW_LABELS=ROWLAB - WIDGET_CONTROL,WSpeceditor, $ - USE_TABLE_SELECT=[0,0,12,nspecgp-1], $ - SET_VALUE=specmat -END diff --git a/model/aux/idl_twist/gridbuild.pro b/model/aux/idl_twist/gridbuild.pro deleted file mode 100644 index 17ae5ee54..000000000 --- a/model/aux/idl_twist/gridbuild.pro +++ /dev/null @@ -1,4504 +0,0 @@ -;/ -;/ +-----------------------------------+ -;/ | TWIST Ifremer-SHOM | -;/ | F. Ardhuin | -;/ | IDL command language | -;/ | Last update : 08-Oct-2013 | -;/ +-----------------------------------+ -;/ -;/ Licence information: This code is distributed under the CeCILL license -;/ generally compatible with the Gnu Public Licence (GPL) -;/ http://www.cecill.info/index.en.html -;/ -;/ 17-Oct-2013 : Clean up ( version 2.00 ) -;/ 08-Nov-2013 : Debug contourline ( version 2.00 ) -; -; 1. Purpose : -; -; GUI for mesh editing -; -; 2. Method : -; -;---------------------------------------------------------------------------- -PRO Generator, anterior_root -; This procedure creates the widged for the "grid designer" subwindow -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -;** 4 ** subwindow widgets widgets -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON WGene,Wgrideditor,WG,root -COMMON Builder,ngp,H0,H1,Hi,KH0,KH1,DX0,DX1,T0,ROA,ROI,gridbuild_click - -;*******END OF COMMON BLOCKS******************************* - IF (datastatus(6) EQ 0) THEN nzone=5 - zcolor=INTARR(nzone+1) - zcolor(1:4)=FINDGEN(4)*10+10 - zcolor(5)=-1. - c_zone=5 - pbase=LONG(0) - vecbase=LONG(0) - Line1=LONG(0) - WGlines=LONARR(10) - WG=LONARR(12,14) - - IF (N_ELEMENTS(contourline) EQ 0) THEN contourline=LONARR(2,2)-1 - Speeds,H0,1/T0,cphi,cg,KH0 - Speeds,H1,1/T0,cphi,cg,KH1 - IF (N_ELEMENTS(gridmat) EQ 0) THEN BEGIN - nngp=1 - gridmat=DBLARR(8,nngp) - x=0. - y=0. - XYtoLATLON,x,y,latdeg,latmin,londeg,lonmin - I=1 - gridmat(0,I-1)=x - gridmat(1,I-1)=y - gridmat(2,I-1)=latdeg - gridmat(3,I-1)=latmin - gridmat(4,I-1)=londeg - gridmat(5,I-1)=lonmin - ENDIF - - -; Guardar valores en variables temporales - root=anterior_root -; WIDGET_CONTROL, root, SENSITIVE=0 - - pbase = WIDGET_BASE(TITLE='Mesh editor', /COLUMN) - WIDGET_CONTROL, pbase, GROUP_LEADER=root - WIDGET_CONTROL, /MANAGED, pbase - Wgrideditor=LONARR(2) - ROWLAB=STRARR(nngp) - ROWLAB(*)=STRCOMPRESS(STRING(INDGEN(nngp)+1)) - IF (nngp EQ 1) THEN ROWLAB=['1'] ELSE ROWLAB = STRING(FINDGEN(nngp)+1, FORMAT='(I8)') - Wgrideditor(1)= $ - WIDGET_TABLE(pbase, /EDITABLE, $ - COLUMN_LABELS=['X','Y','LAT','min','LON','min','contour','depth'], $ - ROW_LABELS=ROWLAB, YSIZE=max([10,nngp]),XSIZE=8, /RESIZEABLE_COLUMNS, $ - /SCROLL,Y_SCROLL_SIZE=10,X_SCROLL_SIZE=8, $ - COLUMN_WIDTHS=[80,80,80,80,80,80,60,90],UNITS=0) - WIDGET_CONTROL,Wgrideditor(1) ,SET_VALUE= gridmat - - - I=0 - WGlines(I)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(I,0)=WIDGET_LABEL(WGlines(I),VALUE='Number of mesh nodes: ') - WG(I,3)=WIDGET_TEXT(WGlines(I), XSIZE=8, YSIZE=1, $ - VALUE=STRCOMPRESS(String(nngp))) - WG(I,5)=WIDGET_LABEL(WGlines(I),VALUE=' ') - WG(I,6)=WIDGET_BUTTON(WGlines(I),VALUE='UNDO') - - I=2 - WGlines(I)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(2,0)=WIDGET_LABEL(WGlines(I),VALUE='Mesh and timesteps:') - WG(2,1)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=[ 'Read model timesteps file', $ - 'Update model timesteps', $ - 'Optimize current node position', $ - 'Optimize nodes position (top 20)']) - WG(2,2)=WIDGET_LABEL(WGlines(I),XSIZE=5,YSIZE=1,VALUE='z-offset:') - WG(2,3)=WIDGET_TEXT(WGlines(I),XSIZE=7,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(zoffset))) - WG(2,4)=WIDGET_BASE(WGlines(I), /ROW,/NonExclusive) - WG(2,5)=Widget_Button(WG(2,4), Value='Update on move') - Widget_Control, WG(2,5), Set_Button=1 - - - I=3 - WGlines(I)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(I,0)=WIDGET_LABEL(WGlines(I),VALUE='Work on nodes / contour: ') - WG(I,1)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=[ 'Initialize to specials from *.grgp', $ - 'Import polymesh rand and insel', $ - 'Initialize to zero', $ - 'Add open contour (DX1 in km)', $ - 'Force open contour (DX1 in km)', $ - 'Remove islands from contour', $ - 'Check for segment crossing', $ - 'Flip ordering of island', $ - 'Filter contour points ( < DX0/2)', $ - 'Remove islands out of contour', $ - 'Add depth line (Hi,DX0 in km):', $ - 'Draw line (DX0 in km)', $ - 'Fill with nodes', $ - 'Updates depths of nodes']) - WG(I,2)=WIDGET_LABEL(WGlines(I),VALUE='In:') - WG(I,3)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=[ 'Whole', $ - 'Zoom', $ - 'c_zone']) - - WG(I,4)=WIDGET_BUTTON(WGlines(I),VALUE='Zoom on point') - WG(I,5)=WIDGET_BUTTON(WGlines(I),VALUE='Zoom -') - - I=4 - WGlines(I)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(I,0)=WIDGET_LABEL(WGlines(I),VALUE='Work on mesh: ') - WG(I,1)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=[ 'Remove selected node with 4 neighbors', $ - 'Remove selected non-bound. node with 3 neighbors', $ - 'Remove selected boundary node with 3 neighbors', $ - 'Remove selected boundary node with 2 neighbors', $ - 'Remove all nodes with 4 neighbors', $ - 'Remove bound. nodes with 3 neigh. (top 200 only)', $ - 'Remove all bound. nodes with 3 neighbors', $ - 'Remove all bound. nodes with 2 neighbors', $ - 'Re-generates outside contour, set Z.', $ - 'Re-generates land+islands depths, set Z.' ]) - WG(I,3)=WIDGET_LABEL(WGlines(I),VALUE='Save file:') - WG(I,4)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=['grid (grgp)','mesh (msh)', $ - 'polymesh rand and insel','shoreline slope','slope grid']) - - - I=5 - WGlines(I)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(I,12)=WIDGET_LABEL(WGlines(I),VALUE='H land/sea:') - WG(I,13)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(Hlandsea))) - WG(I,0)=WIDGET_LABEL(WGlines(I),VALUE='H0:') - WG(I,1)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(H0))) - WG(I,10)=WIDGET_LABEL(WGlines(I),VALUE='Hi:') - WG(I,11)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(Hi))) - WG(I,8)=WIDGET_LABEL(WGlines(I),VALUE='H1:') - WG(I,9)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(H1))) - WG(I,2)=WIDGET_LABEL(WGlines(I),VALUE='DX0:') - WG(I,3)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(DX0))) - WG(I,4)=WIDGET_LABEL(WGlines(I),VALUE='DX1:') - WG(I,5)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(DX1))) - WG(I,6)=WIDGET_LABEL(WGlines(I),VALUE='T0:') - WG(I,7)=WIDGET_TEXT(WGlines(I), $ - XSIZE=5,/EDITABLE,VALUE=strcompress(STRING(T0))) - - I=8 - - WGlines(8)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(I,0)=WIDGET_BUTTON(WGlines(I), VALUE='Move GPs') - WG(I,1)=WIDGET_BUTTON(WGlines(I), VALUE='End of moves') - WG(I,2)=WIDGET_BUTTON(WGlines(I), VALUE='Add GPs') - WG(I,3)=WIDGET_BUTTON(WGlines(I), VALUE='End of adds') - WG(I,3)=WIDGET_BUTTON(WGlines(I), VALUE='Clean GP notri') - WG(I,5)=WIDGET_BUTTON(WGlines(I), VALUE='Add GPspec') - WG(I,6)=WIDGET_BUTTON(WGlines(I), VALUE='Del GP (table)') - WG(I,7)=WIDGET_BUTTON(WGlines(I), VALUE='Del GP (screen)') - - I=6 - WGlines(I)=WIDGET_BASE(pbase, /FRAME, /ROW) - WG(I,0)=WIDGET_LABEL(WGlines(I),VALUE='Make contour:') - WG(I,1)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=[ 'at Hlandsea (DX0)', $ - 'at coastline (DX0)']) - WG(I,2)=WIDGET_LABEL(WGlines(I),VALUE='Make triangles:') - WG(I,3)=WIDGET_DROPLIST(WGlines(I), $ - VALUE=[ 'rough (with land)', $ - 'clean (no land)', 'full (with zones)']) - - Line7 = WIDGET_BUTTON(pbase, VALUE='Close mesh editor') - WIDGET_CONTROL, /REALIZE, pbase - Displaygrid - subwin(3)=1 - XMANAGER, 'GENERATOR', /NO_BLOCK, pbase -RETURN -END - - -;---------------------------------------------------------------------------- -PRO Generator_event, ev -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth -;** 3 ** I/O and data variables -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -;** 4 ** subwindow widgets widgets -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON WGene,Wgrideditor,WG,root -COMMON Builder,ngp,H0,H1,Hi,KH0,KH1,DX0,DX1,T0,ROA,ROI,gridbuild_click -COMMON LOCAL_tri,LIST -COMMON UNDO,gridmat0,nngp0,ntri0,trigp0,contourline0 -COMMON COAST, coastxy,coastl,coastnp,GSHHSPoly,GSHHSPoint,GSHHSPoly2,GSHHSPoint2 -COMMON SHORELINE, slopes -COMMON SHORELINE2, open_boundary -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -;*******END OF COMMON BLOCKS******************************* - - file1='' - type = TAG_NAMES(ev, /STRUCTURE) - ON_IOERROR, not_OPEN - -; -; Prepares for UNDO -; - IF (ev.id NE WG(0,6)) THEN BEGIN - gridmat0=gridmat - nngp0=nngp - IF (N_ELEMENTS(ntri) GT 0) THEN ntri0=ntri - IF (N_ELEMENTS(TRIGP) GT 0) THEN TRIGP0=TRIGP - IF (N_ELEMENTS(contourline) GT 0) THEN contourline0=contourline - ENDIF -; -; Performs actions -; - CASE type OF - 'WIDGET_BUTTON': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'Update on move': updateonmove = 1-updateonmove; - 'Close mesh editor': BEGIN - WIDGET_CONTROL, /DESTROY, ev.top - WIDGET_CONTROL,root, SENSITIVE=1 - subwin(0)=0 - RETURN - END - 'Choose GP #1':BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='gridbuild_draw_event' - gridbuild_click=0 - END - - 'UNDO':BEGIN - gridmat=gridmat0 - nngp=nngp0 - IF (N_ELEMENTS(ntri0) GT 0) THEN BEGIN - ntri=ntri0 - trigp=trigp0 - ENDIF - IF (N_ELEMENTS(contourline0) GT 0) THEN BEGIN - contourline=contourline0 - ENDIF - IF (N_ELEMENTS(TRIGP0) GT 0) THEN BEGIN - TRIGP=TRIGP0 - ENDIF - Displaygrid - END - 'Move GPs':BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='gridbuild_draw_event' - gridbuild_click=1 - END - 'End of moves':BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - END - 'Add GPs':BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='gridbuild_draw_event' - gridbuild_click=2 - FOUND=BYTARR(nngp) - FOR I=0,ntri-1 DO BEGIN - FOUND(TRIGP(I,1:3)-1)=1 - ENDFOR - IND=WHERE(FOUND EQ 0,kount) - IF (kount GT 0) THEN PRINT,'IND IN NO TRI:',IND+1 - END - 'End of adds':BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - END - 'Add GPspec':BEGIN - IF N_ELEMENTS(specmat) NE 0 THEN BEGIN - nngp=nngp+1 - temp=gridmat - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-2)=temp - gridmat(0:5,nngp-1)=specmat(1:6,c_spec) - print,'New GP:',specmat(1:6,c_spec) - ROWLAB=STRCOMPRESS(STRING(FINDGEN(nngp)+1,FORMAT='(I6)')) - gridf=STRARR(6,nngp) - gridf(0:1,*)='(F8.4)' - gridf(2,*)='(I4)' - gridf(3,*)='(F7.3)' - gridf(4,*)='(I5)' - gridf(5,*)='(F10.2)' - - WIDGET_CONTROL,WGrideditor(1),INSERT_ROW=1 - Displaygrid - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp-1)) - ENDIF - END - - 'Zoom on point':BEGIN ; Zooms in on point - selec=WIDGET_INFO(Wgrideditor(1),/TABLE_SELECT) - XC=gridmat(0,selec(1)) - YC=gridmat(1,selec(1)) - ;DELX=(nx-1)*dx*(xll-rlonmin)/ABS(rlonmax-rlonmin) - DDX=ROUND(FLOAT(nx)/100.) - DDY=ROUND(FLOAT(ny)/100.) - PRINT,'xc,yc:',xc,yc,ddx,ddy - nxzmin=MIN([MAX([0,ROUND((xc)/dx)-ddx]),nx-1]) - nyzmin=MIN([MAX([0,ROUND((yc)/dy)-ddy]),ny-1]) - nxzmax=MIN([MAX([0,ROUND((xc)/dx)+ddx]),nx-1]) - nyzmax=MIN([MAX([0,ROUND((yc)/dy)+ddy]),ny-1]) - print,'ZOOM P:',nxzmin,nxzmax,nyzmin,nyzmax - doplot - END - 'Zoom -':BEGIN ; Zooms out of point - selec=WIDGET_INFO(Wgrideditor(1),/TABLE_SELECT) - XC=gridmat(0,selec(1)) - YC=gridmat(1,selec(1)) - ;DELX=(nx-1)*dx*(xll-rlonmin)/ABS(rlonmax-rlonmin) - DDX=ROUND(FLOAT(nx)/30.) - DDY=ROUND(FLOAT(ny)/30.) - PRINT,'xc,yc:',xc,yc,ddx,ddy - nxzmin=MIN([MAX([0,ROUND((xc)/dx)-ddx]),nx-1]) - nyzmin=MIN([MAX([0,ROUND((yc)/dy)-ddy]),ny-1]) - nxzmax=MIN([MAX([0,ROUND((xc)/dx)+ddx]),nx-1]) - nyzmax=MIN([MAX([0,ROUND((yc)/dy)+ddy]),ny-1]) - print,'ZOOM P:',nxzmin,nxzmax,nyzmin,nyzmax - doplot - END - 'Del GP (table)':BEGIN ; Deletes the selected range of grid points - selec=WIDGET_INFO(Wgrideditor(1),/TABLE_SELECT) - idel=selec(3)-selec(1)+1 ;number of deleted grid points - ; print,'selec',selec,'idel:',idel - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,selec(1),5,selec(3)] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF selec(1) gt 0 THEN gridmat(*,0:selec(1)-1)=tempo(*,0:selec(1)-1) - IF selec(1) LT nngp THEN gridmat(*,selec(1):nngp-1)=tempo(*,selec(3)+1:nngp+idel-1) - MAKE_CONTOUR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - END -; - 'Del GP (screen)':BEGIN ; Deletes the selected points - PRINT,'Point ',C_GP - IF (C_GP GT 0 ) THEN BEGIN - PRINT,'Point ',C_GP - idel= 1;number of deleted grid points - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,C_GP-1,5,C_GP-1] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF C_GP gt 1 THEN gridmat(*,0:C_GP-2)=tempo(*,0:C_GP-2) - IF C_GP LT nngp THEN gridmat(*,C_GP-1:nngp-1)=tempo(*,C_GP:nngp) - MAKE_CONTOUR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - PRINT,'Point ',C_GP,' has been deleted.' - C_GP=0 - ENDIF - END - 'Clean GP notri':BEGIN ; - FOUND=BYTARR(nngp) - FOR I=0,ntri-1 DO BEGIN - FOUND(TRIGP(I,1:3)-1)=1 - ENDFOR - IND=WHERE(FOUND EQ 0,kount) - IF (kount GT 0) THEN BEGIN - IND2=REVERSE(SORT(IND)) - PRINT,'IND:',IND2+1 - FOR I=0,kount-1 DO BEGIN - tempo=gridmat - nngp=nngp-1 - gridmat=DBLARR(8,nngp) - J=IND(IND2(I)) - PRINT,'REMOVING IND:',IND2(I),IND(IND2(I)) - - IF J gt 0 THEN gridmat(*,0:J-1)=tempo(*,0:J-1) - IF J LT nngp-1 THEN gridmat(*,J:nngp-1)=tempo(*,J+1:nngp) - ENDFOR - ENDIF - MAKE_CONTOUR - END - - ENDCASE - END - 'WIDGET_TABLE_CH': BEGIN - CASE (ev.id) OF - Wgrideditor(1):BEGIN - IF (ev.type LE 2) THEN BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=valeur, $ - USE_TABLE_SELECT=[ev.x,ev.y,ev.x,ev.y] - ;/USE_TEXT_SELECT - gridmat(ev.X,ev.Y)=valeur(0,0) - Updatetable,ev.X,ev.Y - IF (ev.X EQ 6) THEN MAKE_CONTOUR - ENDIF - END - ENDCASE - END - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE ev.id OF - WG(5,1):BEGIN - H0=FLOAT(value(0)) - Speeds,H0,1/T0,cphi,cg,KH0 - END - WG(2,3):zoffset=FLOAT(value(0)) - WG(5,9):BEGIN - H1=FLOAT(value(0)) - Speeds,H1,1/T0,cphi,cg,KH1 - END - - - - WG(5,11):BEGIN - Hi=FLOAT(value(0)) - Speeds,Hi,1/T0,cphi,cg,KHi - END - WG(5,13):Hlandsea=FLOAT(value(0)) - WG(5,3):DX0=FLOAT(value(0)) - WG(5,5):DX1=FLOAT(value(0)) - WG(5,7):BEGIN - T0=FLOAT(value(0)) - Speeds,H0,1/T0,cphi,cg,KH0 - Speeds,H1,1/T0,cphi,cg,KH1 - END - - WG(2,1): gfact=FLOAT(value(0)) - ENDCASE - END -; -; Management of droplists -; - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WG(3,3) : ROA=ev.index - WG(6,1) : BEGIN - nngp_old2=nngp - IF (ev.index EQ 0 AND N_ELEMENTS(gd) GT 0) THEN BEGIN -; -; Gets a depth contour -; - x=findgen(nx)*dx - y=findgen(ny)*dy - CONTOUR,gd,x,y,LEVELS=Hlandsea,PATH_INFO=info,PATH_XY=xyn,CLOSED=0 -; Converts pixel units to kilometers - xy=CONVERT_COORD(xyn,/NORMAL,/TO_DATA) - -; -; Transforms the coastline data to the same format as the contours -; - ENDIF ELSE BEGIN - x=findgen(nx)*dx - y=findgen(ny)*dy - taille=SIZE(GSHHSPoly) - taille2=SIZE(GSHHSPoint) - Npolymax=taille(1)-1 - cont1={contourc,TYPE:1,HIGH_LOW:1,LEVEL:1, $ - N:1L,OFFSET:1L,VALUE:0.d} - info=REPLICATE(cont1,Npolymax) - Npointmax=taille2(1) - XY=FLTARR(2,Npointmax) - Npoly=0L - Npoint=0L - FOR I=0L,Npolymax-1 DO BEGIN - info(Npoly).TYPE=1 - Npoint_this=0L - FOR J=GSHHSPoly(I,0),GSHHSPoly(I+1,0)-1 DO BEGIN -; IF (GSHHSPoint(J,0) GE 0) AND (GSHHSPoint(J,0) LE dx*(n-1)) $ -; AND (GSHHSPoint(J,1) GE 0) AND (GSHHSPoint(J,1) LE dy*(ny-1)) THEN BEGIN - IF (GSHHSPoint(J,0) GE dx*nxzmin) AND (GSHHSPoint(J,0) LE dx*nxzmax) $ - AND (GSHHSPoint(J,1) GE dy*nyzmin) AND (GSHHSPoint(J,1) LE dy*nyzmax) THEN BEGIN - XY(0:1,Npoint+Npoint_this)=GSHHSPoint(J,0:1) - Npoint_this=Npoint_this+1 - ENDIF ELSE BEGIN -; -; Detects the boundary crossing: TYPE=0 -; - info(Npoly).TYPE=0 - ENDELSE - ENDFOR - info(Npoly).OFFSET=Npoint - Npoint=Npoint+Npoint_this - info(Npoly).N=Npoint_this - IF (Npoint_this GT 0) THEN Npoly=Npoly+1 - ENDFOR -; - IF (NPOLY EQ 0) THEN BEGIN - Print,'Did not find any polygon in zoom window' - RETURN - ENDIF - - info_old=info - info=REPLICATE(cont1,Npoly) - info(0:Npoly-1)=info_old(0:Npoly-1) - ENDELSE -; -; Now works with the contour or coastline data -; - Outdump=0 - - IF (outdump EQ 1) THEN BEGIN - GET_LUN,unit1 - OPENW,unit1,'boundarystuff.txt' - ENDIF - contorder=LONARR(N_ELEMENTS(info.TYPE)) - naddmax=0 - FOR I = 0, (N_ELEMENTS(info.TYPE) - 1 ) DO BEGIN - contorder(I)=info(I).N*((2*info(I).TYPE-1L)) - naddmax=naddmax+info(I).N - ENDFOR - I=WHERE(contorder GT 0,kount) - IF (kount GT 0) THEN contorder(I)=max(contorder)-contorder(I) - addpoints=DBLARR(2,naddmax) - naddpoint=0 -; -;2. Search for boundary intersections -; -;2.1 Sorts the polygons to put first those that cross the boundary (TYPE=0) -; - contorder1=SORT(contorder) -; -;2.2 Searches the polygons -; - FOR J2 = 0, (N_ELEMENTS(info) - 1 ) DO BEGIN - I=contorder1(J2) - S=0. - naddJ=0L - ; Sub-samples the points on the depth contour to make sure that no two points are too close - ; further refined to avoid segments that are too long ? - X0=xy(0,INFO(I).OFFSET) - Y0=xy(1,INFO(I).OFFSET) -; -; First computes the length of the contour -; - FOR J=1L,info(I).N-1 DO BEGIN - X1=xy(0,INFO(I).OFFSET+J) - Y1=xy(1,INFO(I).OFFSET+J) - LENGTH=SQRT((X1-X0)^2+(Y1-Y0)^2) - S=S+LENGTH - X0=X1 - Y0=Y1 - ENDFOR -; -; Only add points along islands that are long enough -; - IF (S GT 2.5*DX0) THEN BEGIN - XB=-9000 - YB=-9000 - XPREV=-9000 - YPREV=-9000 - S=DX0 - naddJ=0L - X0=xy(0,INFO(I).OFFSET+info(I).N-1) - Y0=xy(1,INFO(I).OFFSET+info(I).N-1) - FOR J=info(I).N-2,0,-1L DO BEGIN - X1=xy(0,INFO(I).OFFSET+J) - Y1=xy(1,INFO(I).OFFSET+J) - IF ((X1 NE x(0)) AND (X1 NE MAX(x)) AND $ - (Y1 NE Y(0)) AND (Y1 NE MAX(Y))) THEN BEGIN - - LENGTH=SQRT((X1-X0)^2+(Y1-Y0)^2) - S=S+LENGTH -; -; We should probably add some other constraints (change in angle ...) - IF (S GT DX0) THEN BEGIN - addOK1=0 - IF (naddJ GT 0L) THEN BEGIN -; -; Checks distance with first added point on the island and previous added point -; - L2=SQRT((X1-XB)^2+(Y1-YB)^2) - L1=SQRT((X1-XPREV)^2+(Y1-YPREV)^2) - IF (L2 GT 0.8*DX0 AND L1 GT DX0 ) THEN addOK1=1 - ENDIF ELSE BEGIN - addOK1=1 - ENDELSE - IF (addOK1 EQ 1) THEN BEGIN - naddJ=naddJ+1L - WEIGHT=(DX0-(S-LENGTH)) - addpoints(0,naddpoint-1+naddJ)=X1 - addpoints(1,naddpoint-1+naddJ)=Y1 - XPREV=X1 - YPREV=Y1 - IF (naddJ EQ 1) THEN BEGIN - XB=X1 - YB=Y1 - ENDIF - S=0. - ENDIF ; addOK1 - ENDIF ; S GT DX0 - ENDIF ELSE BEGIN - S=0 - ENDELSE - X0=X1 - Y0=Y1 - ENDFOR - IMIN=0 - - PRINT,'Adding nodes along contour? ',J2,naddj -; -; Removes islands with 2 points or less -; - IF (naddJ GT 2) THEN BEGIN -; -; Corrects for crossing points ... now only in additional list: should probably do -; over the entire contourline ... -; - FOR ITER=0,4 DO BEGIN - NCROSS=0L - FOR J=0L,naddJ-2L DO BEGIN - X1=addpoints(0,naddpoint+J) - Y1=addpoints(1,naddpoint+J) - X2=addpoints(0,naddpoint+J+1) - Y2=addpoints(1,naddpoint+J+1) - K=0L - WHILE (K LT J-1L) DO BEGIN - X3=addpoints(0,naddpoint+K) - Y3=addpoints(1,naddpoint+K) - X4=addpoints(0,naddpoint+K+1) - Y4=addpoints(1,naddpoint+K+1) - - DENOM=(Y4-Y3)*(X2-X1)-(Y2-Y1)*(X4-X3) - IF ABS(DENOM) GT 1E-8 THEN BEGIN -; -; P and Q are the coordinates of the crossing point along the two segments -; - P=((X3-X1)*(Y4-Y3)-(Y3-Y1)*(X4-X3))/DENOM - Q=((X3-X1)*(Y2-Y1)-(Y3-Y1)*(X2-X1))/DENOM - IF (( P GT 0 AND P LT 1 ) AND (Q GT 0 AND Q LT 1)) THEN BEGIN -; -; Flips the crossed part... -; - NCROSS=NCROSS+1L - TEMPO=addpoints(*,naddpoint+K+1L:naddpoint+J) - FOR KK=0L,J-K-1L DO BEGIN - addpoints(*,naddpoint+K+1L+KK)=TEMPO(*,J-K-1L-KK) - ENDFOR - ENDIF - ENDIF - K=K+1L - ENDWHILE - ENDFOR - IF NCROSS EQ 0L THEN BREAK - ENDFOR ;ITER - - IF info(I).TYPE EQ 0 THEN BEGIN - XALL=addpoints(0,naddpoint:naddpoint-1+naddJ) - YALL=addpoints(1,naddpoint:naddpoint-1+naddJ) - XG=gridmat(0,contourline(contourline(1,0),0)) - YG=gridmat(1,contourline(contourline(1,0),0)) -; -; FIX THIS : distances to window frame -; - IF ( (nx-1)*dx-XG LT DX0) THEN $ - DIST2=MAX(XALL , IMIN) ELSE $ - DIST2=SQRT( MIN( (XALL-XG)^2 + (YALL-YG)^2,IMIN) ) - ENDIF - - IF (J2 LT 10) THEN print,'Adding coastline on contour:',J2,info(I).TYPE,naddJ,contourline(1,0)+naddJ,IMIN - INDEX=FINDGEN(naddJ) - gridmatold=gridmat - contold=contourline - nngpold=nngp - nngp=LONG(nngp)+LONG(naddJ) - gridmat=DBLARR(8,nngp) - ncontold=1+contold(1) - ncontnew=1+contold(1)+naddJ - contourline=LONARR(ncontold+naddJ,2) -; updates header of contourline - contourline(0:1,0:1)=contold(0:1,0:1) - contourline(1,0)=contourline(1,0)+naddJ -; copies points before boundary points - IF contold(0,0) GT 0 THEN $ - gridmat(*,0:contold(0,0)-1)=gridmatold(*,0:contold(0,0)-1) -; copies boundary points before last gap (included) - I1=contold(contold(0,0),0) - I2=contold(contold(1,0),0) - gridmat(*,I1:I2)=gridmatold(*,I1:I2) - contourline(2:ncontold-1,*)=contold(2:ncontold-1,*) - ;contourline(2:ncontold-1,0)=FINDGEN(ncontold-2)+contold(0,0) -; adds new points at last gap - IND=contold(contold(1,0),0)+1 - IF (J2 GT 0) THEN BEGIN - gridmat(0:1,IND:IND+naddJ-1)=addpoints(*,naddpoint+REVERSE(SHIFT(INDEX,-IMIN))) - ENDIF ELSE BEGIN - gridmat(0:1,IND:IND+naddJ-1)=addpoints(*,naddpoint+SHIFT(INDEX,-IMIN)) - ENDELSE - contourline(ncontold:ncontold+naddJ-1,0)=FINDGEN(naddJ)+contold(1,0)-1 - contourline(ncontold-2:ncontold+naddJ-1,1)=1 - IF (info(I).TYPE NE 0) THEN BEGIN - contourline(ncontold,1)=-1 - ENDIF ELSE BEGIN - contourline(ncontold:ncontold+naddJ-1,1)=1 - ENDELSE - gridmat(6,contourline(ncontold:ncontold+naddJ-1,0)) $ - =contourline(ncontold:ncontold+naddJ-1,1) -; -; Checks distance with respect to contour -; - DIST1=SQRT( (gridmat(0,contold(1,0)+1)-gridmat(0,contold(1,0)))^2 + $ - (gridmat(1,contold(1,0)+1)-gridmat(1,contold(1,0)))^2 ) - IF info(I).TYPE EQ 0L AND DIST1 LT DX1 THEN BEGIN - contourline(ncontold+1:ncontold+2,1)=1 - gridmat(6,contourline(ncontold+2,1))=1 - ENDIF - IF (J2 LT 10) THEN PRINT,'HEY2 - IF (contold(1,0) LT nngpold-1) THEN $ - gridmat(*,contold(1,0)+naddJ+1:nngp-1)=gridmatold(*,contold(1,0)+1:nngpold-1) - IF (J2 LT 10) THEN print,'New contourline:' ;, FIX(contourline) ; ,FORMAT='(10I8)' - IF (J2 LT 10) THEN PRINT,'HEY3' - ENDIF ; (naddJ GT 0) - ENDIF - ENDFOR - IF (outdump EQ 1) THEN BEGIN - CLOSE,unit1 - FREE_LUN,unit1 - ENDIF - - FOR I=contourline(contourline(0,0),0),contourline(contourline(1,0),0) DO BEGIN - XYtoLatLon,gridmat(0,I),gridmat(1,I),latdeg,latmin,londeg,lonmin - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - ENDFOR - Displaygrid - END - WG(6,3) : BEGIN - CASE ev.index OF - 0:MakeTriangles,0,0 - 1:MakeTriangles,1,0 - 2:MakeTriangles,1,1 - ENDCASE - END -; -; Droplist actions -; - WG(4,1):BEGIN - CASE ev.index OF -; -; Removing node that is in 4 triangles (4 neighbor nodes) -; - 0: BEGIN - IF (C_GP GT 0 ) THEN BEGIN - MESH_CLEAN_4,C_GP - C_GP=0 - ENDIF - END -; -; Removing node that is in 3 triangles (3 neighbor nodes) -; - 1: BEGIN - IF (C_GP GT 0 ) THEN BEGIN - IOBP=0 - MSH_BOUNDARY1,C_GP-1,IOBP - IF (IOBP EQ 0) THEN BEGIN - MESH_CLEAN_3,C_GP - C_GP=0 - ENDIF - ENDIF - END -; -; Removing boundary node that is in 2 triangles (3 neighbor nodes) -; - 2: BEGIN - IF (C_GP GT 0 ) THEN BEGIN - IOBP=0 - MSH_BOUNDARY1,C_GP-1,IOBP - IF (IOBP EQ 1) THEN BEGIN - DELOK = 1 - MESH_CLEAN_2,C_GP,180.,DELOK - C_GP=0 - ENDIF - ENDIF - END - -; -; Removing boundary node that is in 1 triangles (2 neighbors) -; - 3: BEGIN - IF (C_GP GT 0 ) THEN BEGIN - IOBP=0 - MSH_BOUNDARY1,C_GP-1,IOBP - IF (IOBP EQ 1) THEN BEGIN - MESH_CLEAN_1,C_GP - C_GP=0 - ENDIF - ENDIF - END - - 4: BEGIN - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - NODES4=WHERE(NEIGH EQ 4,kount4) - ORDER=REVERSE(SORT(NODES4)) -; Loops in reverse order because the node number will change as nodes are deleted - FOR IDEL=0,kount4-1 DO BEGIN - ;FOR IDEL=0,5 DO BEGIN - PRINT,'Treating node #',NODES4(ORDER(IDEL))+1,', ', IDEL+1,' out of ',kount4 - MESH_CLEAN_4,NODES4(ORDER(IDEL))+1 - ENDFOR - END -; -; Removes boundary nodes with 3 neighbors that are in the top 200 -; - 5: BEGIN - UPDATE_TIMESTEPS - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - FOR IND=0,199 DO BEGIN - IDEL=TIMESTEPS_ORDER(IND) - IF (NEIGH(IDEL) EQ 3 AND IOBP(IDEL) EQ 1 ) THEN BEGIN - DELOK=1 - PRINT,'Treating node #', IDEL+1,IND,' out of 200' - MESH_CLEAN_2,IDEL+1,120., DELOK -; Update TIMESTEPS_ORDER after deletion - IF DELOK EQ 1 THEN BEGIN - TIMESTEPS_ORDER_OLD=TIMESTEPS_ORDER - NODESUP=WHERE(TIMESTEPS_ORDER GT IDEL,kount) - IF (kount GT 0) THEN TIMESTEPS_ORDER(NODESUP) = TIMESTEPS_ORDER(NODESUP)-1 - ENDIF -; Recomputes number of neighbors ... - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - ENDIF - - ENDFOR - END - -; -; Removes all boundary nodes with 3 neighbors -; - 6: BEGIN - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - NODES4=WHERE(NEIGH EQ 3 AND IOBP EQ 1,kount4) - ORDER=REVERSE(SORT(NODES4)) -; Loops in reverse order because the node number will change as nodes are deleted - FOR IDEL=0,kount4-1 DO BEGIN - IF (NEIGH(NODES4(ORDER(IDEL))) EQ 3) THEN BEGIN - DELOK=1 - PRINT,'Treating node #',NODES4(ORDER(IDEL))+1,', ', IDEL+1,' out of ',kount4 - MESH_CLEAN_2,NODES4(ORDER(IDEL))+1,120., DELOK -; Recomputes number of neighbors ... - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - ENDIF - - ENDFOR - END - -; -; Removes all boundary nodes with 2 neighbors -; - 7: BEGIN - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - NODES4=WHERE(NEIGH EQ 2 AND IOBP EQ 1,kount4) - ORDER=REVERSE(SORT(NODES4)) -; Loops in reverse order because the node number will change as nodes are deleted - FOR IDEL=0,kount4-1 DO BEGIN - ;FOR IDEL=0,5 DO BEGIN - PRINT,'Treating node #',NODES4(ORDER(IDEL))+1,', ', IDEL+1,' out of ',kount4 - MESH_CLEAN_1,NODES4(ORDER(IDEL))+1 - ENDFOR - END -; -; Re-generates contour ... -; - 8: BEGIN - IOBP=INTARR(NNGP) - MAXNEIGH=1 - print,'Updates depths on contour ... ' - IF (C_GP LT 0 ) THEN BEGIN -; To be debugged ... - GET_BOUNDARY, IOBP, NEIGHBOR - GetCycleBoundaries, IOBP, NEIGHBOR, NbCycle, LengthCycle, FirstInCycle, StatusCycle - PRINT,'Boundary ?',NbCycle - - - FOR iCycle=0,NbCycle-1 DO BEGIN - TheLength=LengthCycle(iCycle) - PRINT,'CYCLE:',iCycle,TheLength - IPwork=FirstInCycle(iCycle) - FOR I=0,TheLength-1 DO BEGIN - PRINT,'CYCLE:',iCycle,TheLength - IPwork=NEIGHBOR(IPwork) - ENDFOR - ENDFOR - ENDIF - - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - FOR I=0,NNGP-1 DO BEGIN - DEPTHMIN=12000 - DEPTHMAX=3 - IF IOBP(I) EQ 1 THEN BEGIN - ;GRIDMAT(7,I)=3 - - FOR J=0,MAXNEIGH-1 DO BEGIN - IF (VNEIGH(I,J) GT 0) THEN BEGIN - I2=VNEIGH(I,J) - IF (IOBP(I2) EQ 0) THEN BEGIN ; only looks at point in domain - IF GRIDMAT(7,I2) LT DEPTHMIN THEN BEGIN - DEPTHMIN=GRIDMAT(7,I2) - INDMIN=I2 - ;PRINT,I+1,INDMIN+1,NNGP,IOBP(INDMIN+1),DEPTHMIN,c_lon,c_lat - ENDIF - IF GRIDMAT(7,I2) GT DEPTHMAX THEN BEGIN - DEPTHMAX=GRIDMAT(7,I2) - INDMAX=I2 - ;PRINT,I+1,INDMIN+1,NNGP,IOBP(INDMIN+1),DEPTHMIN,c_lon,c_lat - ENDIF - ENDIF - ENDIF - ENDFOR - ENDIF - IF (GRIDMAT(7,I) EQ 3) THEN GRIDMAT(7,I)=DEPTHMIN - ENDFOR - END - -; -; Re-generates contour for islands... -; - 9: BEGIN - IOBP=INTARR(NNGP) - MAXNEIGH=1 - print,'Updates depths on contour ... ' - IF (C_GP LT 0 ) THEN BEGIN -; To be debugged ... - GET_BOUNDARY, IOBP, NEIGHBOR - GetCycleBoundaries, IOBP, NEIGHBOR, NbCycle, LengthCycle, FirstInCycle, StatusCycle - PRINT,'Boundary ?',NbCycle - - - FOR iCycle=0,NbCycle-1 DO BEGIN - TheLength=LengthCycle(iCycle) - PRINT,'CYCLE:',iCycle,TheLength - IPwork=FirstInCycle(iCycle) - FOR I=0,TheLength-1 DO BEGIN - PRINT,'CYCLE:',iCycle,TheLength - IPwork=NEIGHBOR(IPwork) - ENDFOR - ENDFOR - ENDIF - - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - FOR I=0,NNGP-1 DO BEGIN - DEPTHMIN=3 - DEPTHMAX=3 - - X=gridmat(0,I) - Y=gridmat(1,I) - - IF (X GE nxzmin*dx AND X LE nxzmax*dx $ - AND Y GE nyzmin*dy AND y LE nyzmax*dy AND IOBP(I) EQ 1) THEN BEGIN - GRIDMAT(7,I)=3 - - FOR J=0,MAXNEIGH-1 DO BEGIN - IF (VNEIGH(I,J) GT 0) THEN BEGIN - I2=VNEIGH(I,J) - IF (IOBP(I2) EQ 0) THEN BEGIN ; only looks at point in domain - IF GRIDMAT(7,I2) LT DEPTHMIN THEN BEGIN - DEPTHMIN=GRIDMAT(7,I2) - INDMIN=I2 - ;PRINT,I+1,INDMIN+1,NNGP,IOBP(INDMIN+1),DEPTHMIN,c_lon,c_lat - ENDIF - IF GRIDMAT(7,I2) GT DEPTHMAX THEN BEGIN - DEPTHMAX=GRIDMAT(7,I2) - INDMAX=I2 - ;PRINT,I+1,INDMIN+1,NNGP,IOBP(INDMIN+1),DEPTHMIN,c_lon,c_lat - ENDIF - ENDIF - ENDIF - ENDFOR - ENDIF - IF (DEPTHMIN LT 3) THEN BEGIN - GRIDMAT(7,I)=DEPTHMIN-1. - ;PRINT,I+1, GRIDMAT(7,I) - ENDIF - - ENDFOR - END - ENDCASE - END -; ./ - WG(3,1):BEGIN - CASE ev.index OF -; -; initializes grid and contourline -; - 0: BEGIN - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,1,7,nngp-1] - nngp=nspecgp - gridmat=DBLARR(8,nngp) - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - WIDGET_CONTROL,WGrideditor(1),INSERT_ROW=nngp-1 - gridmat(0:5,0:nngp-1)=specmat(1:6,0:nspecgp-1) - contourline=LONARR(2,2)-1 - contourline(1,1)=1 - specmat(0,0:nspecgp-1)=FINDGEN(nspecgp)+1 - Displaygrid - END -; -; Import polymesh rand and insel -; - 1:BEGIN - nngp=0L - contourline=LONARR(2,2)-1 - datastatus(5)=1 - IEL=0L - file1='rand.dat' - GET_LUN,unit1 -; -; reads files a first time to get the array sizes -; - OPENR,unit1,file1 - COMMENT=' ' - READF,unit1,COMMENT - ;PRINT,'Comment:',COMMENT - NRAND=0L - WHILE (NRAND GE 0L) DO BEGIN - READF, unit1,iel - IF iel GE 0L THEN NRAND=NRAND+1L ELSE BREAK - ENDWHILE - CLOSE,unit1 - FREE_LUN,unit1 - - file1='insel.dat' - GET_LUN,unit1 - OPENR,unit1,file1 - READF,unit1,COMMENT - NINS=0L - WHILE (NINS GE 0L) DO BEGIN - READF, unit1,iel - IF iel GE 0 THEN BEGIN - NINS=NINS+1L - ENDIF ELSE BEGIN - IF iel EQ -1 THEN BEGIN - READF,unit1,COMMENT - PRINT,'Comment:',COMMENT - ENDIF ELSE BEGIN - BREAK - ENDELSE - ENDELSE - ENDWHILE - CLOSE,unit1 - FREE_LUN,unit1 - - NNGP=NRAND+NINS - contourline=LONARR(2+NNGP,2) - contourline(0,0)=0 - contourline(1,0)=nngp+1 - contourline(0:1,1)=0 - gridmat=DBLARR(8,NNGP) -; -; reads files a second time to get the data -; - file1='rand.dat' - GET_LUN,unit1 - OPENR,unit1,file1 - READF,unit1,COMMENT - lon=0. - lat=0. - depth=0. - I=0L - WHILE (I LT NRAND) DO BEGIN - READF, unit1,iel,lon,lat,depth - IF iel GE 0L THEN BEGIN -; -; Converts decimal degrees to degree , minute and X, Y -; - latdeg=FLOOR(lat) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(lon) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(lat-latdeg)*60. - lonmin=(lon-londeg)*60. - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - - gridmat(0,I)=x - gridmat(1,I)=y - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - gridmat(6,I)=1 - gridmat(7,I)=depth - contourline(I+2,0)=I - contourline(I+2,1)=gridmat(6,I) - I=I+1L - ENDIF ELSE BREAK - ENDWHILE - CLOSE,unit1 - FREE_LUN,unit1 - - file1='insel.dat' - GET_LUN,unit1 - OPENR,unit1,file1 - READF,unit1,COMMENT - CONTOURVAL=-1 - line=' ' - WHILE (I GE 0L) DO BEGIN - READF, unit1,line - READS,line,iel - IF iel GE 0 THEN BEGIN -; -; Converts decimal degrees to degree , minute and X, Y -; - READS,line,iel,lon,lat,depth - latdeg=FLOOR(lat) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(lon) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(lat-latdeg)*60. - lonmin=(lon-londeg)*60. - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - gridmat(0,I)=x - gridmat(1,I)=y - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - gridmat(6,I)=CONTOURVAL - gridmat(7,I)=depth - contourline(I+2,0)=I - contourline(I+2,1)=gridmat(6,I) - I=I+1L - CONTOURVAL=1 - ENDIF ELSE BEGIN - IF iel EQ -1 THEN BEGIN - READF,unit1,COMMENT - CONTOURVAL=-1 - ENDIF ELSE BEGIN - BREAK - ENDELSE - ENDELSE - ENDWHILE - CLOSE,unit1 - FREE_LUN,unit1 - PRINT,'Rand and Insel:',NRAND,NINS - Displaygrid - END -; -; initializes grid and contourline -; - 2:BEGIN - nngp=0L - contourline=LONARR(2,2)-1 - contourline(*,1)=1 - datastatus(5)=1 - datastatus(6)=0 - FLAGTSTEP=0 - END - -; -; adds open boundary contour -; - 3: BEGIN - LX=(nx-1)*dx - LY=(ny-1)*dy - n1=LX/DX1 - n2=LY/DX1 - ndlon=1+ROUND((rlonmax-rlonmin)/ $ - (ROUND(100.*(rlonmax-rlonmin)/n1)/100.)) - ddlon=(rlonmax-rlonmin)/(ndlon-1) - ndlat=1+ROUND((rlatmax-rlatmin)/ $ - (ROUND(100.*(rlatmax-rlatmin)/n2)/100.)) - ddlat=(rlatmax-rlatmin)/(ndlat-1) - - nngpold=nngp - nngpnew=nngp+2*(ndlon+ndlat)-4 - contourline_all=LONARR(2*(ndlon+ndlat)-4,2) - temp=gridmat - gridmatnew=DBLARR(8,nngpnew) - IF (nngpold GT 0) THEN gridmatnew(*,0:nngpold-1)=temp - -; -; Loops over the 4 sides of the rectangular boundary -; - FOR KK=0,3 DO BEGIN - nmax=ndlon*(1-(KK mod 2))+ndlat*(KK mod 2) - - gaps=0 - - print,'Side ',KK+1,': will now test if each of the ',nmax-1,' points is in land.' - print,'That can take a LOOONNG time if the shoreline data is big ... ' - - FOR I=0,nmax-2 DO BEGIN - CASE KK OF - 0: BEGIN ; bottom line - Inew=I*(FLOAT(nx-1)/FLOAT(ndlon-1)) - Jnew=0 - END - 1: BEGIN ; right - Inew=(nx-1) - Jnew=I*(FLOAT(ny-1)/FLOAT(ndlat-1)) - END - 2: BEGIN ; top - Inew=FLOAT(ndlon-1-I)*(FLOAT(nx-1)/FLOAT(ndlon-1)) - Jnew=ny-1 - END - 3: BEGIN - Inew=0 ;left - Jnew=FLOAT(ndlat-1-I)*(FLOAT(ny-1)/FLOAT(ndlat-1)) - END - ENDCASE - print,'Testing for new point #:',I+1, ' out of ',nmax-1 -; -; Removes points that are in land -; - inland=1 - IF N_ELEMENTS(gd) THEN BEGIN - IF (gd(Inew,Jnew) GT Hlandsea) THEN inland=0 - ENDIF ELSE BEGIN - IN_LAND2,Inew*dx,Jnew*dy,inland - ENDELSE - - IF (inland EQ 0) THEN BEGIN -; -; These points are in sea -; - gridmatnew(0,nngp)=Inew*dx - gridmatnew(1,nngp)=Jnew*dy - contourline_all(nngp-nngpold,0)=nngp - contourline_all(nngp-nngpold,1)=1 - nngp=nngp+1L - ENDIF ELSE BEGIN -; -; These points are in land -; - contourline_all(nngp-nngpold-1,1)=-1 - ENDELSE - ENDFOR - ENDFOR - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-1)=gridmatnew(*,0:nngp-1) - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - contourline=LONARR(2+nngp-nngpold,2) - contourline(0,0)=nngpold - contourline(1,0)=nngp+1 - contourline(0:1,1)=0 - contourline(2:nngp-nngpold+1L,*)=contourline_all(0:nngp-nngpold-1,*) -; Search for gaps to shift the contour point indices so that the first gap is at the end - indexz=WHERE(contourline(2:nngp-nngpold-1,1) EQ -1,kount) - IF (kount GT 0) THEN BEGIN - contourline(2:nngp-nngpold+1,1)=SHIFT(contourline(2:nngp-nngpold+1,1),-indexz(0)-1) - shifted=SHIFT(contourline(2:nngp-nngpold+1,0),-indexz(0)) - gridmat(0,nngpold:nngp-1)=SHIFT(gridmat(0,nngpold:nngp-1),-indexz(0)-1) - gridmat(1,nngpold:nngp-1)=SHIFT(gridmat(1,nngpold:nngp-1),-indexz(0)-1) - ENDIF - contourline(contourline(1,0),1)=1 - gridmat(6,contourline(0,0):contourline(1,0)-2)=contourline(2:nngp-nngpold+1,1) - - FOR I=nngpold,nngp-1 DO BEGIN - XYtoLatLon,gridmat(0,I),gridmat(1,I),latdeg,latmin,londeg,lonmin - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - ENDFOR - - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - END -; - 4: BEGIN -; -; adds open boundary contour (no check on land / sea) -; - LX=(nx-1)*dx - LY=(ny-1)*dy - n1=LX/DX1 - n2=LY/DX1 - ndlon=1+ROUND((rlonmax-rlonmin)/ $ - (ROUND(100.*(rlonmax-rlonmin)/n1)/100.)) - ddlon=(rlonmax-rlonmin)/(ndlon-1) - ndlat=1+ROUND((rlatmax-rlatmin)/ $ - (ROUND(100.*(rlatmax-rlatmin)/n2)/100.)) - ddlat=(rlatmax-rlatmin)/(ndlat-1) - - nngpold=nngp - nngpnew=nngp+2*(ndlon+ndlat)-4 - contourline_all=LONARR(2*(ndlon+ndlat)-4,2) - temp=gridmat - gridmatnew=DBLARR(8,nngpnew) - IF (nngpold GT 0) THEN gridmatnew(*,0:nngpold-1)=temp - - FOR KK=0,3 DO BEGIN - nmax=ndlon*(1-(KK mod 2))+ndlat*(KK mod 2) - - gaps=0 - - print,'The program will now test if each of the ',nmax-1,' points is in land or sea.' - print,'No check on land / sea status ' - - FOR I=0,nmax-2 DO BEGIN - CASE KK OF - 0: BEGIN ; bottom line - Inew=I*(FLOAT(nx-1)/FLOAT(ndlon-1)) - Jnew=0 - END - 1: BEGIN ; right - Inew=(nx-1) - Jnew=I*(FLOAT(ny-1)/FLOAT(ndlat-1)) - END - 2: BEGIN ; top - Inew=FLOAT(ndlon-1-I)*(FLOAT(nx-1)/FLOAT(ndlon-1)) - Jnew=ny-1 - END - 3: BEGIN - Inew=0 ;left - Jnew=FLOAT(ndlat-1-I)*(FLOAT(ny-1)/FLOAT(ndlat-1)) - - END - ENDCASE - - gridmatnew(0,nngp)=Inew*dx - gridmatnew(1,nngp)=Jnew*dy - contourline_all(nngp-nngpold,0)=nngp - contourline_all(nngp-nngpold,1)=1 - nngp=nngp+1L - ENDFOR - ENDFOR - - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-1)=gridmatnew(*,0:nngp-1) - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - contourline=LONARR(2+nngp-nngpold,2) - contourline(0,0)=nngpold - contourline(1,0)=nngp+1 - contourline(0:1,1)=0 - contourline(2:nngp-nngpold+1L,*)=contourline_all(0:nngp-nngpold-1,*) - gridmat(6,contourline(0,0):contourline(1,0))=contourline(2:nngp-nngpold+1,1) - - FOR I=nngpold,nngp-1 DO BEGIN - XYtoLatLon,gridmat(0,I),gridmat(1,I),latdeg,latmin,londeg,lonmin - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - ENDFOR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - END -; - 5: BEGIN -; -; Select island to be removed -; - print,'Click on islands to remove them ...' - WIDGET_CONTROL,Wdraw,EVENT_PRO='gridbuild_draw_event' - gridbuild_click=5 - END - 6: BEGIN -; -; Search for crossing segments -; - NCROSS=0L - FOR J=0,contourline(1,0)-contourline(0,0)-1L DO BEGIN - X1=gridmat(0,contourline(J+2L,0)) - Y1=gridmat(1,contourline(J+2L,0)) - X2=gridmat(0,contourline(J+3L,0)) - Y2=gridmat(1,contourline(J+3L,0)) - IF contourline(J+3L,1) GT 0 THEN BEGIN - K=0L - WHILE (K LT J-1L) DO BEGIN - IF contourline(K+3L,1) GT 0 THEN BEGIN - IF (K GT NNGP-5L ) THEN PRINT,'TEST:',J,K,contourline(K+3L,0),contourline(K+3L,1) - X3=gridmat(0,contourline(K+2L,0)) - Y3=gridmat(1,contourline(K+2L,0)) - X4=gridmat(0,contourline(K+3L,0)) - Y4=gridmat(1,contourline(K+3L,0)) - - DENOM=(Y4-Y3)*(X2-X1)-(Y2-Y1)*(X4-X3) - IF ABS(DENOM) GT 1E-8 THEN BEGIN -; -; P and Q are the coordinates of the crossing point along the two segments -; - P=((X3-X1)*(Y4-Y3)-(Y3-Y1)*(X4-X3))/DENOM - Q=((X3-X1)*(Y2-Y1)-(Y3-Y1)*(X2-X1))/DENOM - IF (( P GT 0 AND P LT 1 ) AND (Q GT 0 AND Q LT 1)) THEN BEGIN -; -; Flips the crossed part... -; - NCROSS=NCROSS+1L - PRINT,'Crossing contour:',J+1,J+2,K+1,K+2 - ENDIF - ENDIF - ENDIF - K=K+1L - ENDWHILE - ENDIF - ENDFOR - END - - 7: BEGIN -; -; Flip the ordering of points along an island -; - print,'C_GP:',C_gp - toto=0 - - J=C_GP-1 - IMIN=0L - IMAX=0L - WHILE (IMIN EQ 0 AND J GT 0) DO BEGIN - IF gridmat(6,J) EQ -1 THEN BEGIN - IMIN=J - ENDIF - J=J-1L - ENDWHILE - IMAX=0L - J=C_GP-1 - WHILE (IMAX EQ 0 AND J LT NNGP-1) DO BEGIN - IF gridmat(6,J) EQ -1 THEN BEGIN - IMAX=J-1 - ENDIF - J=J+1L - ENDWHILE - - NSHIFT=IMIN-(C_GP) - print,'Flip and shift island:',IMIN,C_GP-1,IMAX,NSHIFT - gridmatold=gridmat - gridmatold(6,IMIN)=1 - IF IMAX GE IMIN THEN BEGIN - gridmat(*,IMIN:IMAX)= $ - gridmatold(*,REVERSE(IMIN+SHIFT(FINDGEN(IMAX-IMIN+1),NSHIFT)) ) - contourlineold=contourline - gridmat(6,IMIN)=-1 - gridmat(6,IMAX)=1 - ENDIF - END - -; -; Filter out points closer than DX/2 -; - 8: BEGIN - NSMALL=0L - JFIRST=0L - NISLAND=0L - D2MIN=0.25*DX0^2 - - BADPOINTS=BYTARR(nngp) - FOR J=0L,contourline(1,0)-contourline(0,0)-1L DO BEGIN - I1=contourline(J+2L,0)-1 - - II=contourline(J+2L,1)-1 ; this is < 0 if this point is the first of the island - IF (II LT 0) THEN BEGIN -; -; Goes back to first point of the island -; - J2=JFIRST+2L - I2= contourline(J2,0)-1 - JFIRST=J+1L - NISLAND=NISLAND+1L - D2=(X2-X1)^2 + (Y2-Y1)^2 - ICONT=JFIRST+2L - ENDIF ELSE BEGIN - J2=J+3L - I2=contourline(J2,0)-1 - ICONT=JFIRST+2L - ENDELSE -; - X1=gridmat(0,I1) - Y1=gridmat(1,I1) - X2=gridmat(0,I2) - Y2=gridmat(1,I2) - D2=((X2-X1)^2 + (Y2-Y1)^2) - - lon=gridmat(4,I1)+gridmat(5,I1)/60.0 - lat=gridmat(2,I1)+gridmat(3,I1)/60.0 - lon2=gridmat(4,I2)+gridmat(5,I2)/60.0 - lat2=gridmat(2,I2)+gridmat(3,I2)/60.0 - - IF (D2 LT D2MIN AND BADPOINTS(I1) EQ 0) THEN BEGIN - - IF ROA EQ 1 THEN BEGIN - IF (X1 GE nxzmin*dx AND X1 LE nxzmax*dx $ - AND X2 GE nxzmin*dx AND X2 LE nxzmax*dx $ - AND Y1 GE nyzmin*dy AND y1 LE nyzmax*dy $ - AND y2 GE nyzmin*dy AND y2 LE nyzmax*dy ) THEN BEGIN - PRINT,'To be deleted? ',lon,lat,I1,I2,gridmat(6,I2) - BADPOINTS(I2)=1 - ENDIF - ENDIF ELSE BEGIN - BADPOINTS(I2)=1 - ENDELSE - - IF (BADPOINTS(I2) EQ 1 AND gridmat(6,I2) LT 0 ) THEN BEGIN - foundnext=0 - I3=I2+1 - WHILE (foundnext EQ 0 AND I3 LT NNGP) DO BEGIN - IF BADPOINTS(I3) EQ 0 THEN BEGIN - gridmat(6,I2+1)=-1 - foundnext=1 - ENDIF - I3=I3+1 - ENDWHILE - ENDIF - - ; Marks the first point of the next island - ; PRINT,'TEST1:',SQRT(D2),D2MIN,contourline(J+2L,0)+1,J+1,JFIRST+1L,II - ;print,'This point will be deleted:',I2+1,lon2,lat2,' too close to ',I1+1,',',SQRT(D2),' < ',sqrt(D2MIN) - ENDIF - - - ENDFOR - - - NBAD=WHERE(BADPOINTS EQ 1,kount) - print,'NUMBER OF POINTS TO BE DELETED:',kount,':',NBAD - IF (kount GT 0) THEN BEGIN - FOR IDEL=0,KOUNT-1 DO BEGIN - nngp=nngp-1 ;new number of grid points - tempo=gridmat - print,'HEY:',kount,NBAD(IDEL),NNGP - gridmat=DBLARR(8,nngp) - - gridmat(*,0:NBAD(IDEL)-1)=tempo(*,0:NBAD(IDEL)-1) - gridmat(*,NBAD(IDEL):NNGP-1)=tempo(*,NBAD(IDEL)+1:NNGP) - ENDFOR - MAKE_CONTOUR - ENDIF - -; -; Second pass: remove 1 or 2 point islands -; - JFIRST=0L - BADPOINTS=BYTARR(nngp) - FOR J=0L,contourline(1,0)-contourline(0,0)-1L DO BEGIN - II=contourline(J+3L,1) - IF (II LT 0) THEN BEGIN - ; print,'segment?:',J,JFIRST,contourline(J+1L:J+3L,1) - IF (JFIRST GE (J-1)) THEN BEGIN - BADPOINTS(JFIRST:J)=1 - lon=gridmat(4,J)+gridmat(5,J)/60.0 - lat=gridmat(2,J)+gridmat(3,J)/60.0 - - print,'segment:',JFIRST+1,J+1,lon,lat,' CHECKING:',contourline(J+1L:J+3L,1) - ENDIF - JFIRST=J+1L - ENDIF - ENDFOR - - - NBAD=WHERE(BADPOINTS EQ 1,kount) - print,'NUMBER OF POINTS TO BE DELETED:',kount,':',NBAD - IF (kount GT 0) THEN BEGIN - FOR IDEL=0,KOUNT-1 DO BEGIN - nngp=nngp-1 ;new number of grid points - tempo=gridmat - print,'HEY:',kount,NBAD(IDEL),NNGP - gridmat=DBLARR(8,nngp) - - gridmat(*,0:NBAD(IDEL)-1)=tempo(*,0:NBAD(IDEL)-1) - gridmat(*,NBAD(IDEL):NNGP-1)=tempo(*,NBAD(IDEL)+1:NNGP) - ENDFOR - MAKE_CONTOUR - ENDIF - - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - END - - 9: BEGIN -; -; removes islands that are not in the contour -; - island=0L - TOBEREMOVED=INTARR(NNGP,2) - NREMOVE=0L - INOUT=0 - J0=contourline(2L,0) - subcont=contourline(2L+1:contourline(1,0)+2L,1) - Index=WHERE(subcont LT 0, kount) - J1=contourline(2L+Index(0),0) - IF island EQ 0L THEN BEGIN -; -; Polygon defined by first polygon -; - PX=gridmat(0,J0:J1) - PY=gridmat(1,J0:J1) - NPP=J1-J0+1 - PP=LINDGEN(NPP)+J0 - ENDIF - - FOR I=0L,contourline(1,0)-contourline(0,0) DO BEGIN - IF contourline(I+2,1) LT 0 THEN BEGIN ; this is the first point of the polygon - J0=contourline(I+2L,0) - subcont=contourline(I+2L+1:contourline(1,0)+2L,1) - Index=WHERE(subcont LT 0, kount) - J1=contourline(I+2L+Index(0),0) - - IF island GT 0L THEN BEGIN - - XX=gridmat(0,J0) - YY=gridmat(1,J0) - - PNPOLY,XX,YY,PX,PY,NPP,INOUT - - IF INOUT LT 0 THEN BEGIN - TOBEREMOVED(NREMOVE,0)=J0 - TOBEREMOVED(NREMOVE,1)=J1 - NREMOVE=NREMOVE+1L - ENDIF - ENDIF - island=island+1L - - ENDIF ELSE BEGIN - ;IF (INOUT GT 0) THEN BEGIN - ; TOBEREMOVED(NREMOVE,1)=contourline(I+2,0) - ;ENDIF - ENDELSE - - ENDFOR - PRINT,'NREMOVE:',NREMOVE - FOR I=NREMOVE-1,0,-1 DO BEGIN - J0=TOBEREMOVED(I,0) - J1=TOBEREMOVED(I,1) - print,'CUTTING ...:',I,J0,J1,nngp - IDEL=J1-J0+1 - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF J0 gt 0 THEN gridmat(*,0:J0-1)=tempo(*,0:J0-1) - print,'TEST NN:',nngp,idel,J0,J1,'##',nngp+idel-(J1+1),nngp-J0 - gridmat(*,J0:nngp-1)=tempo(*,J1+1:nngp+idel-1) - MAKE_CONTOUR - ENDFOR - c_gp=0 - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - RETURN - END - - - 10: BEGIN - ; Adds points along the depth contour given by Hi - ; with a resoltuion DX0 - IF ROA EQ 1 THEN BEGIN - x=(findgen(nxzmax-nxzmin+1)+nxzmin)*dx - y=(findgen(nyzmax-nyzmin+1)+nyzmin)*dy - CONTOUR,gd(nxzmin:nxzmax,nyzmin:nyzmax),x,y,LEVELS=Hi,PATH_INFO=info,PATH_XY=xyn,CLOSED=0 - ENDIF ELSE BEGIN - x=findgen(nx)*dx - y=findgen(ny)*dy - CONTOUR,gd,x,y,LEVELS=Hi,PATH_INFO=info,PATH_XY=xyn,CLOSED=0 - ENDELSE - xy=CONVERT_COORD(xyn,/NORMAL,/TO_DATA) - addpoints=FLTARR(2,5000)+nx*dx+ny*dy - naddpoint=0 - print,'Depth:',Hi,' spacing :',dx0 - FOR I = 0, (N_ELEMENTS(info) - 1 ) DO BEGIN - S=0. - X0=xy(0,INFO(I).OFFSET) - Y0=xy(1,INFO(I).OFFSET) - FOR J=1,info(I).N-1 DO BEGIN - X1=xy(0,INFO(I).OFFSET+J) - Y1=xy(1,INFO(I).OFFSET+J) - S=SQRT((x1-x0)^2+(y1-y0)^2) - IF (S GT DX0) AND ((X1 NE x(0)) AND (X1 NE MAX(x)) AND $ - (Y1 NE Y(0)) AND (Y1 NE MAX(Y))) THEN BEGIN - d2gp=MIN((X1-gridmat(0,0:nngp-1))^2+(Y1-gridmat(1,0:nngp-1))^2) - d2ad=MIN((X1-addpoints(0,0:naddpoint))^2+(Y1-addpoints(1,0:naddpoint))^2) - IF (d2gp GT 0.25*DX0^2) AND (d2ad GT 0.25*DX0^2) THEN BEGIN - print,d2gp,d2ad,dx0,x1,y1,nngp+naddpoint - naddpoint=naddpoint+1 - addpoints(0,naddpoint-1)=X1 - addpoints(1,naddpoint-1)=Y1 - S=0. - X0=X1 - Y0=Y1 - ENDIF - ENDIF - ENDFOR - ENDFOR - nngp=nngp+naddpoint - temp=gridmat - gridmat=DBLARR(8,nngp) - IF (nngp GT naddpoint) THEN gridmat(*,0:nngp-naddpoint-1)=temp - gridmat(0:1,nngp-naddpoint:nngp-1)=addpoints(0:1,0:naddpoint-1) - - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - FOR I=1,naddpoint DO BEGIN - XYtoLatLon,gridmat(0,nngp-I),gridmat(1,nngp-I),latdeg,latmin,londeg,lonmin - gridmat(2,nngp-I)=latdeg - gridmat(3,nngp-I)=latmin - gridmat(4,nngp-I)=londeg - gridmat(5,nngp-I)=lonmin - ENDFOR - PRINT,naddpoint,' new nodes.' - Displaygrid - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - MakeTriangles,0,0 - END - 11:BEGIN ;changes the gridbuild_clik option ot allow the interactive - ;addition of points along a line that is defined with two points selected - ;with the mouse - WIDGET_CONTROL,Wdraw,EVENT_PRO='gridbuild_draw_event' - gridbuild_click=3 - END -; - 12:BEGIN - tri_break=BYTARR(ntri+1) - xg=FLTARR(ntri+1) - yg=FLTARR(ntri+1) - DXMAX=FLTARR(ntri+1) - trigpnew=FLTARR(ntri*3,4) - TRIGPNEW(0:ntri,0:3)=trigp(0:ntri,0:3) - FOR I=1,NTRI DO BEGIN - IF (I MOD 5000) EQ 0 THEN PRINT,'Looking at triangle ',I,NTRI - IF TRIGP(I,1) GE 0 THEN BEGIN - x1=MAX([0,MIN([(nx-1)*dx,gridmat(0,TRIGP(I,1)-1)])]) - x2=MAX([0,MIN([(nx-1)*dx,gridmat(0,TRIGP(I,2)-1)])]) - x3=MAX([0,MIN([(nx-1)*dx,gridmat(0,TRIGP(I,3)-1)])]) - y1=MAX([0,MIN([(ny-1)*dy,gridmat(1,TRIGP(I,1)-1)])]) - y2=MAX([0,MIN([(ny-1)*dy,gridmat(1,TRIGP(I,2)-1)])]) - y3=MAX([0,MIN([(ny-1)*dy,gridmat(1,TRIGP(I,3)-1)])]) - xg(I)=(x1+x2+x3)/3. - yg(I)=(y1+y2+y3)/3. - tri_in_ROA=0 - IF (ROA EQ 1) THEN BEGIN - IF ((xg(I)/dx GT FLOAT(nxzmin)) AND (xg(I)/dx LT FLOAT(nxzmax)) $ - AND (yg(I)/dy GT FLOAT(nyzmin)) AND (yg(I)/dy LT FLOAT(nyzmax))) THEN tri_in_ROA=1 - ENDIF ELSE tri_in_ROA=1 - - IF (tri_in_ROA EQ 1) THEN BEGIN - depthtri=(gd(x1/dx,y1/dy)+gd(x2/dx,y2/dy)+gd(x3/dx,y3/dy) $ - +3.*gd(xg(I)/dx,yg(I)/dy))/6. - Speeds,MAX([MIN([depthtri,H1]),H0]),1/T0,cphi,cg,KH - d1=sqrt((x3-x2)^2+(y3-y2)^2) - d2=sqrt((x3-x1)^2+(y3-y1)^2) - d3=sqrt((x1-x2)^2+(y1-y2)^2) - dmax=ABS(MAX([d1,d2,d3])) - aamin=100. - ddmin=100. - DXmax(I)=DX0+(DX1-DX0)*(TANH(KH)-TANH(KH0))/(TANH(KH1)-TANH(KH0)) - IF (dmax GT DXmax(I)) THEN BEGIN - a1=ASIN(((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/(d3*d2)) - a2=ASIN(((x3-x2)*(y1-y2)-(x1-x2)*(y3-y2))/(d1*d3)) - a3=ASIN(((x1-x3)*(y2-y3)-(x2-x3)*(y1-y3))/(d2*d1)) -; distances from barycenter - d5=sqrt((xg-x2)^2+(yg-y2)^2) - d4=sqrt((xg-x1)^2+(yg-y1)^2) - d6=sqrt((xg-x3)^2+(yg-y3)^2) -; angles relative to barycenter - a4=ASIN(((x2-xg)*(y3-yg)-(x3-xg)*(y2-yg))/(d5*d6)) - a5=ASIN(((x3-xg)*(y1-yg)-(x1-xg)*(y3-yg))/(d4*d6)) - a6=ASIN(((x1-xg)*(y2-yg)-(x2-xg)*(y1-yg))/(d4*d5)) - amin=ABS(MIN([a1,a2,a3])) - amax=ABS(MAX([a4,a5,a6])) - dmin=ABS(MIN([d1,d2,d3])) - IF (dmin LT ddmin) THEN BEGIN - ddmin=dmin - Imin=I - ENDIF - DXmax(I)=DXmax(I)*( 0.5 + 1.5*amin/!pi ) - - IF amin LT !pi/10 AND tri_in_ROA THEN PRINT,'WARNING: SMALL ANGLE',I,TRIGP(I,1)-1, $ - TRIGP(I,2)-1,TRIGP(I,3)-1,amin/!dtor - IF dmin LT DXmax(I)*0.1 AND tri_in_ROA THEN PRINT,'WARNING: SMALL TRIANGLE',I,TRIGP(I,1)-1, $ - TRIGP(I,2)-1,TRIGP(I,3)-1,dmin,DXmax(I) - IF dmin LT DXmax(I)*0.1 AND tri_in_ROA THEN PRINT,'WARNING: NEW TRI TOO FLAT',I,TRIGP(I,1)-1, $ - TRIGP(I,2)-1,TRIGP(I,3)-1,amax - IF (dmax GT DXmax(I)) AND (amax LT !pi*0.8 ) AND tri_in_ROA THEN tri_break(I)=1 - ENDIF - ENDIF - ENDIF - ENDFOR - ; PRINT,'DDMIN:',ddmin,Imin,trigp(Imin,*)-1 - - - ; Makes sure that new node - ; is not too close (dx0) to old ones - index=WHERE(tri_break EQ 1,naddpoint) - naddtrue=0 - IF naddpoint NE 0 THEN BEGIN - FOR I=1,ntri DO BEGIN - IF tri_break(I) THEN BEGIN - IN_SEA,xg(I),yg(I),in - index2=WHERE(tri_break EQ 2,naddpoint2) - d2gp=MAX((Xg(I)-gridmat(0,0:nngp-1))^2+(Yg(I)-gridmat(1,0:nngp-1))^2) - d2gpm=MIN((Xg(I)-gridmat(0,0:nngp-1))^2+(Yg(I)-gridmat(1,0:nngp-1))^2) - d2new=1.5*DXmax(I)^2 - IF naddpoint2 NE 0 THEN d2new=MIN((Xg(I)-XG(index2))^2+(Yg(I)-YG(index2))^2) - IF (d2gp GT DXmax(I)^2) AND (d2new GT DXmax(I)^2) AND (in EQ 1) THEN BEGIN - tri_break(I)=2 - naddtrue=naddtrue+1 - ENDIF - print,'BREAK:',I,XG(I),YG(I),d2gp,d2gpm,DXmax(I),tri_break(I) - - ENDIF - ENDFOR - ENDIF - index=WHERE(tri_break EQ 2,naddpoint) - PRINT,'add points:',naddpoint - IF naddpoint GT 1 THEN BEGIN - ntriold=ntri - trigpold=trigp - nngp=nngp+naddpoint - temp=gridmat - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-naddpoint-1)=temp - gridmat(0,nngp-naddpoint:nngp-1)=xg(index) - gridmat(1,nngp-naddpoint:nngp-1)=yg(index) - INDNEW=nngp+1+FINDGEN(naddpoint)-naddpoint - ; Redifines the triangles - PRINT,'add triangles:',naddpoint,ntri,ntri+2*naddpoint,'##',indnew - ; defines zones of new triangles - TRIGPNEW(ntri+1:ntri+naddpoint,0)=TRIGPNEW(index,0) - TRIGPNEW(ntri+1+naddpoint:ntri+2*naddpoint,0)=TRIGPNEW(index,0) - PRINT,'add triangles 1:' - ; first point of new triangles: barycenter - TRIGPNEW(ntri+1:ntri+naddpoint,1)=INDNEW - TRIGPNEW(ntri+1+naddpoint:ntri+2*naddpoint,1)=INDNEW - PRINT,'add triangles 2:' - ; second point of new triangles: points 1 or 2 - TRIGPNEW(ntri+1:ntri+naddpoint,2)=TRIGPNEW(index,1) - TRIGPNEW(ntri+1+naddpoint:ntri+2*naddpoint,2)=TRIGPNEW(index,2) - ; 3rd point of new triangles: point 3 - TRIGPNEW(ntri+1:ntri+naddpoint,3)=TRIGPNEW(index,3) - TRIGPNEW(ntri+1+naddpoint:ntri+2*naddpoint,3)=TRIGPNEW(index,3) - ; 3rd point of old triangle : barycenter - TRIGPNEW(index,3)=INDNEW - ntri=ntri+2*naddpoint - TRIGP=INTARR(ntri+1,4) - TRIGP(*,*)=TRIGPNEW(0:ntri,*) - PRINT,'add triangles 3:' - - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - PRINT,'Recomputes XY:' - FOR I=1,naddpoint DO BEGIN - XYtoLatLon,gridmat(0,nngp-I),gridmat(1,nngp-I),latdeg,latmin,londeg,lonmin - gridmat(2,nngp-I)=latdeg - gridmat(3,nngp-I)=latmin - gridmat(4,nngp-I)=londeg - gridmat(5,nngp-I)=lonmin - ENDFOR - PRINT,'Displays grid:' - Displaygrid - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - ENDIF - END -; -; Updates depths -; - 13:BEGIN - IF datastatus(2) THEN BEGIN - FOR I=0,nngp-1 DO BEGIN - X=[gridmat(0,I)] - Y=[gridmat(1,I)] - IF (X GT rangex(0) AND X LT rangex(1) and Y GT rangey(0) and Y LT rangey(1)) THEN BEGIN - x1=(X)/dx - i1=FLOOR(x1) - ip1=MIN([nx-1,i1+1]) - dx1=x1-i1 - y1=(y)/dy - j1=FLOOR(y1) - jp1=MIN([ny-1,j1+1]) - dy1=y1-j1 - d1=gd(i1,j1 ) - d2=gd(ip1,j1 ) - d3=gd(i1,jp1) - d4=gd(ip1,jp1) - depthnew=(d1*(1-dx1)+d2*dx1)*(1-dy1) + (d3*(1-dx1)+d4*dx1)*dy1 - ;PRINT,'TEST:',I+1,gridmat(7,I),depthnew,gd(i1,j1),gd(ip1,jp1),dx1,dy1,i1,ip1,j1,jp1 - IF (d1 GT -9 AND d2 GT -9 AND d3 GT -9 AND d4 GT -9 ) THEN gridmat(7,I)=depthnew - ENDIF - ENDFOR - ENDIF - END - ENDCASE - END -; -; Timesteps droplist - -; -; Read coordinates of nodes with smallest timesteps -; - WG(2,1):BEGIN - CASE ev.index OF - 0:BEGIN - GET_LUN,unit1 - FILE1='timesteps.dat' - OPENR,unit1,FILE1 - NTIMESTEPS=MAX([NNGP,200]) - TIMESTEPS=FLTARR(4,NTIMESTEPS) - NRAND=0L - lon=0. - lat=0. - depth=0. - IND1=0 - IND2=0 - tstep=0. - dummy=' ' - READF, unit1,dummy - FOR I=0,NTIMESTEPS-1 DO BEGIN - READF, unit1,IND1,tstep,lon,lat,depth - TIMESTEPS(0,I)=IND1 - TIMESTEPS(1,I)=tstep - latdeg=FLOOR(lat) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(lon) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(lat-latdeg)*60. - lonmin=(lon-londeg)*60. - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - TIMESTEPS(2,I)=X - TIMESTEPS(3,I)=Y - ENDFOR - FLAGTSTEP=1 - CLOSE,unit1 - FREE_LUN,unit1 - END - 1: IF (N_ELEMENTS(NTRI) GT 0) THEN UPDATE_TIMESTEPS -; -; Optimize position of current node -; - 2: BEGIN - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - IND=WHERE(IOBP EQ 1) - SIRATIO(IND)=0 - IF (IOBP(C_GP-1) EQ 0) THEN MESH_OPTIMIZE,C_GP - END -; -; Optimize position of top 20 nodes (not boundary) -; - 3: BEGIN - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - IND=WHERE(IOBP EQ 1) - SIRATIO(IND)=0 - FOR IND=0,NTIMESTEPS/10-1 DO BEGIN - IP=TIMESTEPS_ORDER(IND) - IF (IOBP(IP) EQ 0 ) THEN BEGIN - PRINT,'Working on node ',IP+1,'. ',IND+1,'out of ',NTIMESTEPS/10 - MESH_OPTIMIZE,IP+1 - ENDIF - ENDFOR - END - ENDCASE - END -; -; File output droplist -; - WG(4,4):BEGIN - CASE ev.index OF - 0:BEGIN ;write grid file - file=DIALOG_PICKFILE(/READ,PATH = PATHS(5), FILTER ='*.grgp') - IF !VERSION.OS_FAMILY EQ 'Windows' THEN $ - spos=RSTRPOS(file,'\') ELSE spos=RSTRPOS(file,'/') - PATHS(5)=STRMID(file,0,spos+1) - filenopath=STRMID(file,spos+1,STRLEN(file)-spos-1) - filenames(5)=filenopath - IF file NE '' THEN BEGIN - GET_LUN,unit - OPENW,unit,file - PRINTF,unit,nngp,' Number of grid points' - - FOR I=1,(nngp) DO BEGIN - PRINTF,unit,I,gridmat(0:7,I-1), $ - FORMAT='(I6,2F9.4,I5,F9.4,I5,F9.4)' - ENDFOR - CLOSE,unit - FREE_LUN,unit - ENDIF - END - 1:BEGIN ;write triangle mesh with gmesh format - file=DIALOG_PICKFILE(/READ, PATH = PATHS(7),FILTER ='*.msh') - IF !VERSION.OS_FAMILY EQ 'Windows' THEN $ - spos=RSTRPOS(file,'\') ELSE spos=RSTRPOS(file,'/') - PATHS(7)=STRMID(file,0,spos+1) - filenopath=STRMID(file,spos+1,STRLEN(file)-spos-1) - filenames(7)=filenopath - IF file NE '' THEN BEGIN - GET_LUN,unit - OPENW,unit,file - PRINTF,unit,'$MeshFormat' - PRINTF,unit,'2 0 8' - PRINTF,unit,'$EndMeshFormat' - ;IF (datastatus(2)) THEN PRINTF,unit,'$File 2 ',paths(2),filenames(2) - ;IF (datastatus(3)) THEN PRINTF,unit,'$File 3 ',paths(3),filenames(3) - ;IF (datastatus(18)) THEN PRINTF,unit,'$File 18 ',paths(18),filenames(18) - PRINTF,unit,'$Nodes' - PRINTF,unit,nngp - FOR I=0L,nngp-1 DO BEGIN - x1=MAX([0,MIN([(nx-1),gridmat(0,I)/dx])]) - y1=MAX([0,MIN([(ny-1),gridmat(1,I)/dy])]) - lon=gridmat(4,I)+gridmat(5,I)/60.0 - lat=gridmat(2,I)+gridmat(3,I)/60.0 - IX=FLOOR(X1) - IP1=min([IX+1,nx-1]) - JY=FLOOR(Y1) - JP1=min([JY+1,ny-1]) - xx=X1-IX - yy=Y1-JY - ;IF (n_ELEMENTS(gd) GT 0) THEN $ - ; z=(gd(IX,JY) *(1-xx)+gd(IP1,JY )*xx)*(1-yy) $ - ; +(gd(IX,JP1)*(1-xx)+gd(IP1,JP1)*xx)*yy+4. $ - ;ELSE $ - z=gridmat(7,I) - PRINTF,unit,I+1,lon,lat,z,FORMAT='(I8,2F16.10,F10.3)' - ENDFOR - PRINTF,unit,'$EndNodes' - PRINTF,unit,'$Elements' - - iel=1L - island=0L - -; BIG BUG AFTER GRID EDIT ... COMES FROM BUG IN MAKE_CONTOUR ... -; As a result we list here some nodes with depth > H0 - PRINT,'Number of elements in contour:', N_ELEMENTS(contourline) - IF N_ELEMENTS(contourline) GE -4 THEN BEGIN - PRINT,'Not enough contour points ... lists nodes with depth > H0' - NOBC=0L - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - Index=WHERE(IOBP EQ 1,kount) - FOR I=0,NNGP-1 DO BEGIN - DEPTHMIN=3 - IF IOBP(I) EQ 1 AND GRIDMAT(7,I) GT H0 THEN NOBC = NOBC +1 - ENDFOR - PRINTF,unit,NOBC+NTRI ; total number of elements - FOR I=0,NNGP-1 DO BEGIN - DEPTHMIN=3 - IF IOBP(I) EQ 1 AND GRIDMAT(7,I) GT H0 THEN BEGIN - PRINTF,unit,iel,' 15 2 0',island,I+1 - iel=iel+1L - ENDIF - ENDFOR - ENDIF ELSE BEGIN - PRINTF,unit,1L+contourline(1,0)-contourline(0,0)+ntri - - FOR I=0L,contourline(1,0)-contourline(0,0) DO BEGIN - IF contourline(I+2,1) LT 0 THEN island=island+1L - PRINTF,unit,iel,' 15 2 0',island,contourline(I+2,0)+1 - iel=iel+1 - ENDFOR - ENDELSE -; - FOR I=0L,ntri-1 DO BEGIN - PRINTF,unit,iel,' 2 3 0 ',I+1, $ - TRANSPOSE(TRIGP(I+1,0:3)), FORMAT='(I9,A,I9,4I9)' - iel=iel+1 - ENDFOR - PRINTF,unit,'$EndElements' - CLOSE,unit - FREE_LUN,unit - ENDIF - END - 2:BEGIN ;export information for Polymesh - file1='rand.dat' - GET_LUN,unit1 - OPENW,unit1,file1 - iel=0L - island=0L - PRINTF,unit1,'C Insel',island - FOR I=2L,contourline(1,0) DO BEGIN - IF contourline(I,1) LT 0L AND I GT 2 THEN BEGIN -; -; Jumps to the next island -; - IF island EQ 0L THEN BEGIN - PRINTF,unit1, FORMAT='(I10)',-1 - file2='insel.dat' - CLOSE,unit1 - FREE_LUN,unit1 - GET_LUN,unit1 - OPENW,unit1,file2 - ENDIF ELSE BEGIN -; -; Test if this is the last island -; - IF (I LT contourline(1,0)-contourline(0,0) ) THEN $ - PRINTF,unit1, FORMAT='(I10)',-1 - ENDELSE - island=island+1L - iel=0L - PRINTF,unit1,'C Insel',island - ENDIF - J=contourline(I,0) - lon=gridmat(4,J)+gridmat(5,J)/60.0 - lat=gridmat(2,J)+gridmat(3,J)/60.0 -; -; J+1L instead of iel: easier to track the point numbers ... -; - PRINTF, unit1, FORMAT='(I10,3F16.6)',J+1L,lon,lat, gridmat(7,J) - iel=iel+1L - ENDFOR - IF (island GT 0) THEN BEGIN - PRINTF,unit1, FORMAT='(I10)',-2 - CLOSE,unit1 - FREE_LUN,unit1 - ENDIF - END ; end of polymesh output -; - 3:BEGIN ;export shoreline slope - file1='shoreline_slope.dat' - GET_LUN,unit1 - OPENW,unit1,file1 - island=0L - print,'TEST SLOPES',N_ELEMENTS(slopes) - IF N_ELEMENTS(slopes) NE nngp THEN BEGIN - slopes=FLTARR(nngp) - ENDIF ELSE BEGIN - print,'Updating shoreline slopes' - ENDELSE - IBOUND=0 - FOR IC=0L,contourline(1,0)-contourline(0,0) DO BEGIN - IF contourline(IC+2,1) LT 0 THEN island=island+1L - depthc=0.2 -; FOR I=0,nngp-1 DO BEGIN - I=contourline(IC+2,0) - - ;IF (ABS(gridmat(6,I)) EQ 1) THEN BEGIN - IBOUND=IBOUND+1 - X=[gridmat(0,I)] - Y=[gridmat(1,I)] - IF (X GT rangex(0) AND X LT rangex(1) and Y GT rangey(0) and Y LT rangey(1)) THEN BEGIN - nxz1=MIN([MAX([1,ROUND((X)/dx-45)]),nx-2]) - nyz1=MIN([MAX([1,ROUND((Y)/dy-45)]),ny-2]) - nxz2=MIN([MAX([1,ROUND((X)/dx+45)]),nx-2]) - nyz2=MIN([MAX([1,ROUND((Y)/dy+45)]),ny-2]) - gd1=gd(nxz1:nxz2,nyz1:nyz2)-depthc - gd2=gd(nxz1+1:nxz2+1,nyz1:nyz2)-depthc - gd3=gd(nxz1:nxz2,nyz1+1:nyz2+1)-depthc - prod1=gd1*gd2 - prod2=gd1*gd3 - x2=(repmat((findgen(nxz2-nxz1+1)+nxz1)*dx,1,nyz2-nyz1+1)-replicate(X,nxz2-nxz1+1,nyz2-nyz1+1)) - ;x2=repmat((findgen(nxz2-nxz1+1)+nxz1)*dx,1,nyz2-nyz1+1) - y2=(repmat(transpose((findgen(nyz2-nyz1+1)+nyz1)*dy),nxz2-nxz1+1,1)-replicate(Y,nxz2-nxz1+1,nyz2-nyz1+1)) - J=where(prod1 LT 0 OR prod2 LT 0,kount) - ;IF (I EQ 5807) THEN PRINT,'TOTO A',kount,prod1(*,16) - IF (kount GT 0) THEN BEGIN - dist=x2(J)^2+y2(J)^2; - DMIN=MIN(dist,location) - ;ind = ARRAY_INDICES(x2, J(location)) - ARRAY_IND2,x2, J(location),ind - IF (ind[0] LT nxz2-nxz1 AND ind[1] LT nyz2-nyz1) THEN BEGIN - if (gd1(ind[0],ind[1]) GT depthc AND gd1(ind[0]+1,ind[1]) LT depthc) THEN ind(0)=ind(0)-1 $ - ELSE ind(0)=ind(0)+1 - if (gd1(ind[0],ind[1]) GT depthc AND gd1(ind[0],ind[1]+1) LT depthc) THEN ind(1)=ind(1)-1 $ - ELSE ind(1)=ind(1)-1 - slope=0.001*sqrt(((gd1(ind[0],ind[1])-gd1(ind[0]+1,ind[1]))/dx)^2 $ - +((gd1(ind[0],ind[1])-gd1(ind[0],ind[1]+1))/dy)^2) - ;PRINT,'HEY:',I+1,sqrt(DMIN),slope,'##',gd1(ind[0],ind[1]),gd1(ind[0]+1,ind[1]),gd1(ind[0],ind[1]+1) - slopes(I)=MAX([slope,0.001]) - IF (slopes(I) GT 4) THEN slopes(I) = 0.0 ; this is for bad bathymetry data ... - ;IF (I EQ 5807) THEN PRINT,'HEY END:',I+1,slopes(I) - ENDIF - ENDIF - ENDIF - ;IF (I EQ 5807) THEN PRINT,'TOTO',slopes(I),I+1,contourline(IC+2,0)+1 - IF (slopes(I) GT 0) THEN BEGIN - PRINTF,unit1,IBOUND,' 15 3 ',open_boundary(I),island,slopes(I),contourline(IC+2,0)+1 - ENDIF ELSE BEGIN - PRINTF,unit1,IBOUND,' 15 2 ',open_boundary(I),island,contourline(IC+2,0)+1 - ENDELSE - - ;ENDIF - ENDFOR - CLOSE,unit1 - FREE_LUN,unit1 - END - - 4:BEGIN ; export slope grid (from gd) - slopes=gd*0. - dxlat=REPLICATE(dx,ny) - lats=rlatmin+FINDGEN(ny)*(rlatmax-rlatmin)/(ny-1); - dxlat(*)=(rlonmax-rlonmin)/(nx-1) $ - *cos(lats*!dtor)*4E4/360. ; spacing in km - nse=3 - depthc=0.2 - counter=-10L - dminOK=(3*dy)^2 - FOR J=nse,ny-1-nse DO BEGIN - nsy=ROUND(nse*dx/dxlat(J)) - Imax=2*nsy - Jmax=2*nse - PRINT,'j:',j,max(slopes(*,j-1)),nsy - FOR I=nse,nx-1-nse DO BEGIN - nxz1=MIN([MAX([1,I-nsy]),nx-2]) - nyz1=MIN([MAX([1,J-nse]),ny-2]) - nxz2=MIN([MAX([1,I+nsy]),nx-2]) - nyz2=MIN([MAX([1,J+nse]),ny-2]) - gd1=gd(nxz1:nxz2,nyz1:nyz2)-depthc - gd2=gd(nxz1+1:nxz2+1,nyz1:nyz2)-depthc - gd3=gd(nxz1:nxz2,nyz1+1:nyz2+1)-depthc - prod1=gd1*gd2 - prod2=gd1*gd3 - x2=(repmat((findgen(nxz2-nxz1+1)+nxz1-I)*dxlat(J),1,nyz2-nyz1+1)) - y2=(repmat(transpose((findgen(nyz2-nyz1+1)+nyz1-J)*dy),nxz2-nxz1+1,1)) - JJ=where(prod1 LT 0 OR prod2 LT 0,kount) - ;IF (I EQ 5807) THEN PRINT,'TOTO A',kount,prod1(*,16) - IF (kount GT 0) THEN BEGIN - dist=x2(JJ)^2+y2(JJ)^2; - DMIN=MIN(dist,location) - ;ind = ARRAY_INDICES(x2, JJ(location)) - ARRAY_IND2,x2, JJ(location),ind - IF (ind[0] LT nxz2-nxz1-1 AND ind[1] LT nyz2-nyz1-1) THEN BEGIN - counter=counter+1 - ; IF (counter EQ 1) THEN PRINT,'X2:',X2 - ; IF (counter EQ 1) THEN PRINT,'Y2:',Y2 - ; IF (counter EQ 1) THEN PRINT,'gd:',gd1 - ; IF (counter EQ 1) THEN PRINT,'in:',ind,prod1(JJ(location)),prod2(JJ(location)) - ; IF (counter EQ 1) THEN PRINT,'pr:',prod1 - ; IF (counter EQ 1) THEN PRINT,'p2:',prod2 - ; IF (counter EQ 1) THEN PRINT,'HEY:',sqrt(DMIN),'##',gd1(ind[0],ind[1]),gd1(ind[0]+1,ind[1]), $ - ; gd1(ind2[0],ind2[1]),gd2(ind2[0],ind2[1]+1) - if (gd1(ind[0],ind[1]) GT depthc AND gd1(ind[0]+1,ind[1]) LT depthc) THEN ind(0)=ind(0)-1 - IF (ind(0) GT 0) THEN BEGIN - if (gd1(ind[0],ind[1]) LT depthc AND gd1(ind[0]+1,ind[1]) GT depthc) THEN ind(0)=ind(0)+1 - IF (ind(0) LT Imax) THEN BEGIN - ind2=ind - if (gd1(ind2[0],ind2[1]) GT depthc AND gd1(ind2[0],ind2[1]+1) LT depthc) THEN ind2(1)=ind2(1)-1 - IF (ind2(1) GT 0) THEN BEGIN - - if (gd1(ind2[0],ind2[1]) LT depthc AND gd1(ind2[0],ind2[1]+1) GT depthc) THEN ind2(1)=ind2(1)+1 - IF (ind2(1) LT Jmax) THEN BEGIN - - IF (counter EQ 1) THEN PRINT,'i2:',ind,ind2 - slope=0.001*sqrt(((gd1(ind[0],ind[1])-gd1(ind[0]+1,ind[1]))/dxlat(J))^2 $ - +((gd1(ind2[0],ind2[1])-gd1(ind2[0],ind2[1]+1))/dy)^2) - IF (counter EQ 1) THEN PRINT,'HEY:',sqrt(DMIN),slope,'##',gd1(ind[0],ind[1]),gd1(ind[0]+1,ind[1]), $ - gd1(ind2[0],ind2[1]),gd2(ind2[0],ind2[1]+1) - ;PRINT,'HEY:',I+1,sqrt(DMIN),slope,'##',gd1(ind[0],ind[1]),gd1(ind[0]+1,ind[1]),gd1(ind[0],ind[1]+1) - slopes(I,J)=MAX([slope,0.001]) - - ENDIF - ENDIF - ENDIF - ENDIF - ENDIF - ENDIF - ENDFOR - ENDFOR - GET_LUN,unit1 - OPENW,unit1,paths(3)+'etopo2_slopes.grd',/SWAP_ENDIAN - WRITEU,unit1,transpose(slopes) -PRINT,'MIN / MAX:',MIN(slopes),MAX(slopes) - CLOSE,unit1 - FREE_LUN,unit1 - - END - ENDCASE ; end of file output droplist - END - - ENDCASE ; end of droplists - END - ENDCASE -RETURN - CLOSE,unit1 -NOT_OPEN: print,'Error in opening or reading file: ',file1,' . Unexpected results may occur ...' - -RETURN -END - -;---------------------------------------------------------------------------- -PRO MakeTriangles,excludeland,dozones -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON TRIANGLE2,nzonetri,zonetri,nzonegp,zonegp,ngpzone,gpzone -COMMON Builder,ngp,H0,H1,Hi,KH0,KH1,DX0,DX1,T0,ROA,ROI,gridbuild_click -COMMON LOCAL_tri,LIST -;*******END OF COMMON BLOCKS******************************* - X=FLTARR(NNGP) - Y=FLTARR(NNGP) - X(*)=(gridmat(0,0:nngp-1)) - Y(*)=(gridmat(1,0:nngp-1)) - TRIANGULATE, X, Y, DELTRI, BOUNDARY, $ - CONNECTIVITY=LIST, REPEATS=REP - TAILLE=SIZE(DELTRI) -; -; Clean up triangles in land -; - IF excludeland THEN BEGIN - n_cont=0 - IF (n_ELEMENTS(contourline) GT 4) THEN n_cont=(contourline(1,0)-contourline(0,0)+1) - IF (n_cont GT 0) THEN BEGIN - ntri=Taille(2) - nsea=0 - SEATRI=LONARR(ntri) - FOR I=0L,ntri-1 DO BEGIN - I1=DELTRI(0,I) - I2=DELTRI(1,I) - I3=DELTRI(2,I) - IF (I1 LT contourline(0,0) OR I1 GT contourline(1,0)) $ - AND (I2 LT contourline(0,0) OR I2 GT contourline(1,0)) $ - AND (I3 LT contourline(0,0) OR I3 GT contourline(1,0)) THEN BEGIN - addtri=1 - ENDIF ELSE BEGIN - xt=gridmat(0,DELTRI(0:2,I)) - yt=gridmat(1,DELTRI(0:2,I)) - xg=TOTAL(xt)/3. - yg=TOTAL(yt)/3. - IN_SEA,xg,yg,addtri - ENDELSE - IF addtri THEN BEGIN - SEATRI(nsea)=I - nsea=nsea+1 - ENDIF - ENDFOR - DELTRI_OLD=DELTRI - DELTRI=LONARR(3,nsea) - DELTRI(*,*)=DELTRI_OLD(*,SEATRI(0:nsea-1)) - ENDIF - TAILLE=SIZE(DELTRI) - ENDIF - ;PRINT,'N points:',N_ELEMENTS(X) - ;PRINT,'N triangles:',Taille(2) - ;****************************************************** - ; Creates the triangles and zones (SUBDOMAINS) - ;****************************************************** - ntri=Taille(2) - TRIGP=INTARR(ntri+1,4) - xmax=(NX-1)*dx - ymax=(Ny-1)*dy - xg=FLTARR(ntri+1) - yg=FLTARR(ntri+1) - DXMAX=FLTARR(ntri) - TRIGP(1:ntri,0)=5 - -print,'TRI OK, NOW DOING ZONES',ntri - DIAGNOSTICS=FLTARR(ntri,3) - ddmin=100. - Imin=0 - FOR I=0,(ntri-1) DO BEGIN - ; (X(DELTRI(0,I)) LT 0.) OR (X(DELTRI(1,I)) LT 0.) $ - ; OR (X(DELTRI(2,I)) LT 0) THEN IZONE=1 - ;IF (X(DELTRI(0,I)) GT xmax) OR (X(DELTRI(1,I)) GT xmax) $ - ; OR (X(DELTRI(2,I)) GT xmax) THEN IZONE=2 - trigp(I+1,1)=DELTRI(0,I)+1 - trigp(I+1,2)=DELTRI(1,I)+1 - trigp(I+1,3)=DELTRI(2,I)+1 - IZONE=5 - IF (Y(DELTRI(0,I)) LT 0.) OR (Y(DELTRI(1,I)) LT 0.) $ - OR (Y(DELTRI(2,I)) LT 0) THEN IZONE=3 - IF (Y(DELTRI(0,I)) GT ymax) OR (Y(DELTRI(1,I)) GT ymax) $ - OR (Y(DELTRI(2,I)) GT ymax) THEN IZONE=4 - x1=MAX([0,MIN([(nx-1),gridmat(0,TRIGP(I+1,1)-1)])]) - x2=MAX([0,MIN([(nx-1),gridmat(0,TRIGP(I+1,2)-1)])]) - x3=MAX([0,MIN([(nx-1),gridmat(0,TRIGP(I+1,3)-1)])]) - y1=MAX([0,MIN([(ny-1),gridmat(1,TRIGP(I+1,1)-1)])]) - y2=MAX([0,MIN([(ny-1),gridmat(1,TRIGP(I+1,2)-1)])]) - y3=MAX([0,MIN([(ny-1),gridmat(1,TRIGP(I+1,3)-1)])]) - xg(I)=(x1+x2+x3)/3. - yg(I)=(y1+y2+y3)/3. - d1=sqrt((x3-x2)^2+(y3-y2)^2) - d2=sqrt((x3-x1)^2+(y3-y1)^2) - d3=sqrt((x1-x2)^2+(y1-y2)^2) - area=ABS((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)) - a1=ASIN(((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/(d3*d2)) - a2=ASIN(((x3-x2)*(y1-y2)-(x1-x2)*(y3-y2))/(d1*d3)) - a3=ASIN(((x1-x3)*(y2-y3)-(x2-x3)*(y1-y3))/(d2*d1)) - amin=ABS(MIN([a1,a2,a3])) - dmin=ABS(MIN([d1,d2,d3])) - dmax=ABS(MAX([d1,d2,d3])) - ;IF (TRIGP(I+1,1) GT 1050 AND TRIGP(I+1,1) LT 1053) THEN BEGIN - ; PRINT,'#########DETAILS:',I+1,TRIGP(I+1,*) - ; PRINT,'area:',AREA,a1,a2,a3,d1,d2,d3,amin,dmin,dmax,AREA/dmax - ; ENDIF - DIAGNOSTICS(I,0)=AMIN - DIAGNOSTICS(I,1)=dmin - DIAGNOSTICS(I,2)=2.*AREA/dmax - ;depthtri=(gd(x1/dx,y1/dy)+gd(x2/dx,y2/dy)+gd(x3/dx,y3/dy) $ - ; +3.*gd(xg(I)/dx,yg(I)/dy))/6. - ;Speeds,MAX([MIN([depthtri,H1]),H0]),1/T0,cphi,cg,KH - d1=sqrt((x3-x2)^2+(y3-y2)^2) - d2=sqrt((x3-x1)^2+(y3-y1)^2) - d3=sqrt((x1-x2)^2+(y1-y2)^2) - a1=ASIN(((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/(d3*d2)) - a2=ASIN(((x3-x2)*(y1-y2)-(x1-x2)*(y3-y2))/(d1*d3)) - a3=ASIN(((x1-x3)*(y2-y3)-(x2-x3)*(y1-y3))/(d2*d1)) - amin=ABS(MIN([a1,a2,a3])) - dmin=ABS(MIN([d1,d2,d3])) - IF (dmin LT ddmin) THEN BEGIN - ddmin=dmin - Imin=I - ENDIF - IF amin LT !pi/10 THEN trigp(I+1,0)=0 - DXmax(I)=DX0 ;+(DX1-DX0)*(TANH(KH)-TANH(KH0))/(TANH(KH1)-TANH(KH0)) - DXmax(I)=DXmax(I)*( 0.5 + 1.5*amin/!pi ) - IF dmin LT DXmax(I)*0.1 THEN trigp(I+1,0)=1 - IF dozones THEN BEGIN - IZONE=c_zone - IF (Y(DELTRI(0,I)) LT 0.) OR (Y(DELTRI(1,I)) LT 0.) $ - OR (Y(DELTRI(2,I)) LT 0) THEN IZONE=3 - IF (Y(DELTRI(0,I)) GT ymax) OR (Y(DELTRI(1,I)) GT ymax) $ - OR (Y(DELTRI(2,I)) GT ymax) THEN IZONE=4 - IF depthtri LT H0 THEN IZONE=1 - IF depthtri GT H1 THEN IZONE=2 - trigp(I+1,0)=IZONE - ENDIF - ENDFOR - IF excludeland EQ 1 THEN BEGIN - FOR I=0,nngp-1 DO BEGIN - IN_SEA,gridmat(0,I),gridmat(1,I),in - IF (in EQ 0 AND gridmat(6,I) EQ 0) THEN PRINT,'WARNING 0: POINT',I+1,' IN LAND.' - ENDFOR - FOR I=0,ntri-1 DO BEGIN - - IF (DIAGNOSTICS(I,0) LT 0.2) THEN PRINT,'WARNING 1:', $ - I+1,TRANSPOSE(DIAGNOSTICS(I,0:2)),TRIGP(I+1,1),TRIGP(I+1,2),TRIGP(I+1,3) - IF (DIAGNOSTICS(I,1) LT DX0 OR DIAGNOSTICS(I,2) LT DX0 ) THEN PRINT,'WARNING 2:', $ - I+1,TRANSPOSE(DIAGNOSTICS(I,0:2)),TRIGP(I+1,1),TRIGP(I+1,2),TRIGP(I+1,3) - ENDFOR - ENDIF - - PRINT,'DDMIN:',ddmin,Imin,trigp(Imin+1,*) - - IF (N_ELEMENTS(REP) GT 2) THEN PRINT,'WARNING: REPEATED POINTS',REP - IF dozones THEN BEGIN - FOR I=0,(ntri-1) DO BEGIN - - ; Sorts the vertices within each triangle - IF trigp(I+1,1) GT TRIGP(I+1,2) THEN BEGIN - tempo=TRIGP(I+1,2) - TRIGP(I+1,2)=trigp(I+1,1) - trigp(I+1,1)=tempo - ENDIF - IF trigp(I+1,2) GT TRIGP(I+1,3) THEN BEGIN - tempo=TRIGP(I+1,3) - TRIGP(I+1,3)=trigp(I+1,2) - trigp(I+1,2)=tempo - ENDIF - IF trigp(I+1,1) GT TRIGP(I+1,2) THEN BEGIN - tempo=TRIGP(I+1,2) - TRIGP(I+1,2)=trigp(I+1,1) - trigp(I+1,1)=tempo - ENDIF - ENDFOR - ; Sorts the triangles by first point... - FIRSTS=LONARR(ntri+1) - ;PRINT,'nnGP',nngp - ;PRINT,TRANSPOSE(TRIGP) - - FIRSTS(*)=LONG(TRIGP(*,3))+(nngp+1)*LONG((TRIGP(*,2)) $ - +(nngp+1)*LONG(TRIGP(*,1))) - ;PRINT,'FIRSTS:',FIRSTS - ORDER=SORT(FIRSTS) - ;PRINT,'ORDER:',ORDER - TRIGP(*,0:3)=TRIGP(ORDER(*),0:3) - ;PRINT,TRANSPOSE(TRIGP) - ; Tests if all the boundary points are actually outside the domain - nboundary=N_ELEMENTS(BOUNDARY) - FOR I=0,nboundary-1 DO BEGIN - IF X(BOUNDARY(I)) LE xmax AND X(BOUNDARY(I)) GE 0 $ - AND Y(BOUNDARY(I)) LE ymax AND Y(BOUNDARY(I)) GE 0 THEN $ - PRINT,'Warning, point #',I+1,' is on the boundary and in the domain' - ENDFOR - - - zones=INTARR(ntri+1) - zones(*)=TRIGP(0:ntri,0) - SO=(SORT(zones)) - zones2=INDGEN(ntri+1) - zones2=zones2(SO) - zones=zones(SO) - - zonetri=INTARR(nzone+2+ntri) - ZC=1 ; current zone - ZONETRI(1)=nzone+2 - ZT=1 ; numbers of triangles in zone - ZZ=1 - FOR I=2,ntri DO BEGIN - IF zones(I) NE ZC THEN BEGIN - ZONETRI(ZC+1)=ZONETRI(ZC)+ZT - temp=zones2(ZZ:ZZ+ZT-1) - ZONETRI(ZONETRI(ZC):ZONETRI(ZC+1)-1)=temp(SORT(temp)) - ZZ=ZZ+ZT - ZT=0 - ZC=ZC+1 - ENDIF - ZT=ZT+1 - ENDFOR - ZONETRI(nzone+1)=NZONE+NTRI+2 - temp=zones2(ZZ:ZZ+ZT-1) - ;print,I,ZONETRI(nzone),ZONETRI(nzone+1)-1,size(temp),temp - ZONETRI(ZONETRI(nzone):ZONETRI(nzone+1)-1)=temp(SORT(temp)) - - nzonetri=ZONETRI(nzone+1)-1 - - ZONEGP=INTARR(nzone+2+NTRI*3) - index=nzone+2 - ZONEGP(1)=index - FOR I=1,nzone DO BEGIN - ZONEGP(I+1)=ZONEGP(I) - FOR J=ZONETRI(I),ZONETRI(I+1)-1 DO BEGIN - TRIC=ZONETRI(J) - FOR K=1,3 DO BEGIN - GPC=TRIGP(TRIC,K) - found=0 - FOR L=ZONEGP(I),ZONEGP(I+1)-1 DO $ - IF ZONEGP(L) EQ GPC THEN found=1 - IF found EQ 0 THEN BEGIN - ZONEGP(ZONEGP(I+1))=GPC - ZONEGP(I+1)=ZONEGP(I+1)+1 - ENDIF - ENDFOR - ENDFOR - ENDFOR - - nzonegp=ZONEGP(nzone+1) - - GPZONE=INTARR(nngp*4) - - index=nngp+2 - GPZONE(1:nngp+1)=index - FOR I=1,nzone DO BEGIN - FOR J=ZONEGP(I),ZONEGP(I+1)-1 DO BEGIN - GPC=ZONEGP(J) - IF GPZONE(NNGP+1) GT GPZONE(GPC) THEN $ - GPZONE(GPZONE(GPC)+1:GPZONE(NNGP+1))=GPZONE(GPZONE(GPC):GPZONE(NNGP+1)-1) - GPZONE(GPC+1:NNGP+1)=GPZONE(GPC+1:NNGP+1)+1 - GPZONE(GPZONE(GPC))=I - ENDFOR - ENDFOR - ngpzone=GPZONE(nngp+1)-1 - - ENDIF -print,'END OF TRI',ntri - datastatus(6)=1 - RETURN - END - -;---------------------------------------------------------------------------- -PRO gridbuild_draw_event,ev -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri - -COMMON Builder,ngp,H0,H1,Hi,KH0,KH1,DX0,DX1,T0,ROA,ROI,gridbuild_click - -COMMON WGene,Wgrideditor,WG,root -COMMON LOCAL_gridbuild,coordP,coordR,nxz1,nyz1,nxz2,nyz2,indexgp -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER -COMMON TIMESTEPSUG2, CCON, IEN, SI, AREA, WCG, CELLVERTEX, IE_CELL, POS_CELL, C, K -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -;*******END OF COMMON BLOCKS******************************* - CASE ev.type OF ;case loop on action types - 0:BEGIN ;ev.type=0 : click (button pushed down) - coordP=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - ;coordP(0)=MIN([MAX([0.,coordP(0)]),(nx-1)*dx]) - ;coordP(1)=MIN([MAX([0.,coordP(1)]),(ny-1)*dy]) - CASE gridbuild_click OF - 1:BEGIN ;move GP - indexgp=0 - distmin=(coordP(0)-gridmat(0,0))^2 $ - +(coordP(1)-gridmat(1,0))^2 - FOR I=1,nngp-1 DO BEGIN - dist=(coordP(0)-gridmat(0,I))^2 $ - +(coordP(1)-gridmat(1,I))^2 - IF (dist LT distmin) THEN BEGIN - indexgp=I - distmin=dist - ENDIF - ENDFOR - ;end of search - ;highlights the grid point with a big triangle - OPLOT,[gridmat(0,indexgp)],[gridmat(1,indexgp)], $ - psym=5,SYMSIZE=1.5,COLOR=0 - indexgp=indexgp+1 - END - 2:BEGIN ; Add point - nngp=nngp+1 - temp=gridmat - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-2)=temp - gridmat(0,nngp-1)=coordP(0) - gridmat(1,nngp-1)=coordP(1) - XYtoLatLon,coordP(0),coordP(1),latdeg,latmin,londeg,lonmin - print,'New GP:',coordP(0),coordP(1),latdeg,latmin,londeg,lonmin - gridmat(2,nngp-1)=latdeg - gridmat(3,nngp-1)=latmin - gridmat(4,nngp-1)=londeg - gridmat(5,nngp-1)=lonmin - IF (adsyms/2) THEN BEGIN - strlab=strcompress(string(nngp)) - OPLOT,[gridmat(0,nngp-1)],[gridmat(1,nngp-1)], $ - psym=psyms(0),SYMSIZE=psymsizes(0) - XYOUTS,gridmat(0,nngp-1),gridmat(1,nngp-1),strlab,CHARSIZE=0.5 - ENDIF - WIDGET_CONTROL,WGrideditor(1),TABLE_YSIZE=nngp - WIDGET_CONTROL,WGrideditor(1), SET_VALUE=gridmat(0:7,0:nngp-1) - END - 3: - 4: - 5:BEGIN ; removel island island in contour - distmin=(coordP(0)-gridmat(0,0))^2 $ - +(coordP(1)-gridmat(1,0))^2 - found=0 - FOR I=1,nngp-1 DO BEGIN - dist=(coordR(0)-gridmat(0,I))^2 $ - +(coordR(1)-gridmat(1,I))^2 - IF (dist LT distmin) THEN BEGIN - index1=I - distmin=dist - found=1 - ENDIF - ENDFOR -; -; Finds range of node indices to be removed -; - IF FOUND EQ 1 THEN BEGIN - IMIN=0L - J=index1 - WHILE (IMIN EQ 0 AND J GT 0) DO BEGIN - IF gridmat(6,J) EQ -1 THEN BEGIN - IMIN=J - ENDIF - J=J-1L - ENDWHILE - IMAX=0L - J=index1 - WHILE (IMAX EQ 0 AND J LT NNGP-1) DO BEGIN - IF gridmat(6,J) EQ -1 THEN BEGIN - IMAX=J-1 - ENDIF - J=J+1L - ENDWHILE - selec=LONARR(4) - selec(1)=IMIN - selec(3)=IMAX - idel=selec(3)-selec(1)+1 - print,'Removing island of node ',index1, ', nodes in range:',IMIN,IMAX - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,selec(1),5,selec(3)] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF selec(1) gt 0 THEN gridmat(*,0:selec(1)-1)=tempo(*,0:selec(1)-1) - IF selec(1) LT nngp THEN gridmat(*,selec(1):nngp-1)=tempo(*,selec(3)+1:nngp+idel-1) - MAKE_CONTOUR - - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - ENDIF - END - ELSE: - ENDCASE - END - 1:BEGIN ;ev.type=1 button release - coordR=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - coordR(0)=MIN([MAX([0.,coordR(0)]),(nx-1)*dx]) - coordR(1)=MIN([MAX([0.,coordR(1)]),(ny-1)*dy]) - CASE gridbuild_click OF - 0:BEGIN ;gridbuild_click option to choose the position - ;of the first grid point. Used by the - ;grid builder - IF datastatus(3) EQ 1 THEN BEGIN - i1=FLOOR(gridmat(0,0)/dx) - j1=FLOOR(gridmat(1,0)/dy) - IF ((i1 GE 0) AND (i1 LT nx) $ - AND (j1 GE 0) AND (j1 LT ny)) THEN $ - depth1=gd(i1,j1) ELSE depth1=0. - lev1=0 - FOR K=1,numlevels-1 DO BEGIN - IF lev(K) LT depth1 THEN lev1=k - ENDFOR - OPLOT,[gridmat(0,0)],[gridmat(1,0)], $ - psym=5,SYMSIZE=0.6,COLOR=colorind(lev1) - XYOUTS,gridmat(0,0),gridmat(1,0),'1', $ - CHARSIZE=0.9,COLOR=colorind(lev1) - ENDIF - gridmat(0,0)=coordR(0) - gridmat(1,0)=coordR(1) - XYtoLatLon,coordP(0),coordP(1),latdeg,latmin,londeg,lonmin - print,'New GP:',coordP(0),coordP(1),latdeg,latmin,londeg,lonmin - UpdateTable,0,0 ;updates the positions - ;of the first grid point - OPLOT,[gridmat(0,0)],[gridmat(1,0)], $ - psym=5,SYMSIZE=0.6 - XYOUTS,gridmat(0,0),gridmat(1,0),'1', $ - CHARSIZE=0.9 - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - END - 1:BEGIN ; moves grid point - i1=FLOOR(gridmat(0,indexgp-1)/dx) - j1=FLOOR(gridmat(1,indexgp-1)/dy) - OPLOT,[gridmat(0,indexgp-1)],[gridmat(1,indexgp-1)], $ - psym=5,SYMSIZE=1.5 ;,COLOR=colorind(lev1) - strlab=strcompress(string(indexgp),/REMOVE_ALL) - XYOUTS,gridmat(0,indexgp-1),gridmat(1,indexgp-1), $ - strlab,CHARSIZE=0.9 ;,COLOR=colorind(lev1) - gridmat(0,indexgp-1)=coordR(0) - gridmat(1,indexgp-1)=coordR(1) - XYtoLatLon,coordR(0),coordR(1),latdeg,latmin,londeg,lonmin - gridmat(2,indexgp-1)=latdeg - gridmat(3,indexgp-1)=latmin - gridmat(4,indexgp-1)=londeg - gridmat(5,indexgp-1)=lonmin - print,'point #',indexgp - ;IF subwin(0) THEN UpdateTable,0,indexgp-1 - OPLOT,[gridmat(0,indexgp-1)],[gridmat(1,indexgp-1)], $ - psym=5,SYMSIZE=0.6 - XYOUTS,gridmat(0,indexgp-1),gridmat(1,indexgp-1), $ - strlab,CHARSIZE=0.9 -; - IF FLAGTSTEP AND UPDATEONMOVE THEN BEGIN - UPDATE_TIMESTEPS2,indexgp-1 - doplot - ENDIF - - END - 3:BEGIN ;picks up the second end of the line to be drawn - - nadd=FLOOR(SQRT((coordR(0)-coordP(0))^2 $ - +(coordR(1)-coordP(1))^2)/DX0)+2 - - xadd=FLTARR(nadd) - yadd=FLTARR(nadd) - naddpoint=0 - iadd=INTARR(nadd) - FOR I = 0, nadd-1 DO BEGIN - Xadd(naddpoint)=coordP(0)+I*(coordR(0)-coordP(0))/(nadd-1) - Yadd(naddpoint)=coordP(1)+I*(coordR(1)-coordP(1))/(nadd-1) - d2gp=MIN((Xadd(I)-gridmat(0,0:nngp-1))^2+(Yadd(I)-gridmat(1,0:nngp-1))^2) - IF (d2gp GT 0.25*DX0^2) THEN BEGIN - print,d2gp,dx0,Xadd(naddpoint),Yadd(naddpoint) - naddpoint=naddpoint+1 - iadd(I)=1 - ENDIF - ENDFOR - nngp=nngp+naddpoint - temp=gridmat - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-naddpoint-1)=temp - II=nngp-naddpoint - FOR I = 0, nadd-1 DO BEGIN - IF Iadd(I) EQ 1 THEN BEGIN - gridmat(0,II)=Xadd(I) - gridmat(1,II)=Yadd(I) - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - XYtoLatLon,Xadd(I),Yadd(I),latdeg,latmin,londeg,lonmin - gridmat(2,II)=latdeg - gridmat(3,II)=latmin - gridmat(4,II)=londeg - gridmat(5,II)=lonmin - II=II+1 - ENDIF - ENDFOR - Displaygrid - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - END - - ELSE: - ENDCASE - END ;when the button is released - - ; Updates the cursor position and value of the current field - 2:IF datastatus (2) THEN BEGIN ;ev.type=2 when the cursor is in - ;in the drawing window - coord=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - i0=FLOOR(coord(0)/dx) - j0=FLOOR(coord(1)/dy) - IF ((i0 GE 0) AND (i0 LT nx) $ - AND (j0 GE 0) AND (j0 LT ny) $ - AND datastatus(3)) THEN BEGIN - valeur=gd(i0,j0) - WIDGET_CONTROL,Wright(14,5), $ - SET_VALUE=STRING(valeur,FORMAT='(F8.2)') - ENDIF - WIDGET_CONTROL,Wright(14,1), $ - SET_VALUE=STRING(coord(0),FORMAT='(F7.3)') - WIDGET_CONTROL,Wright(14,3), $ - SET_VALUE=STRING(coord(1),FORMAT='(F6.2)') - latdeg=0. - latmin=0. - londeg=0. - lonmin=0. - latlonstring='' - XYtoLatLon,coord(0),coord(1), $ - latdeg,latmin,londeg,lonmin,latlonstring - WIDGET_CONTROL,Wright(15,1), $ - SET_VALUE=latlonstring - ENDIF - ELSE: - ENDCASE - -RETURN -END - -;---------------------------------------------------------------------------- -PRO UpdateTable,I,J -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -;** 4 ** subwindow widgets widgets -COMMON WGene,Wgrideditor,WG,root -;*******END OF COMMON BLOCKS******************************* - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - x=0. - y=0. - - CASE 1 OF - (I LT 2):BEGIN ;updates the grid points latitudes and longitudes - XYtoLatLon,gridmat(0,J),gridmat(1,J),latdeg,latmin,londeg,lonmin - gridmat(2,J)=latdeg - gridmat(3,J)=latmin - gridmat(4,J)=londeg - gridmat(5,J)=lonmin - END - ELSE:BEGIN ;updates the grid points X and Y coordinates - LatLontoxy,gridmat(2,J),gridmat(3,J),gridmat(4,J),gridmat(5,J),x,y - gridmat(0,J)=x - gridmat(1,J)=y - END - ENDCASE - WIDGET_CONTROL, Wgrideditor(1), SET_VALUE=gridmat(0:7,J:J), $ - USE_TABLE_SELECT=[0,J,7,J] - RETURN -END - -;---------------------------------------------------------------------------- -PRO Displaygrid -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -;** 4 ** subwindow widgets widgets -COMMON WGene,Wgrideditor,WG,root -;*******END OF COMMON BLOCKS******************************* - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - IF (nngp EQ 1) THEN ROWLAB=['1'] ELSE ROWLAB = STRING(FINDGEN(nngp)+1, FORMAT='(I8)') - WIDGET_CONTROL,WGrideditor(1),TABLE_YSIZE=nngp - WIDGET_CONTROL,Wgrideditor(1),ROW_LABELS=ROWLAB - WIDGET_CONTROL,WGrideditor(1), SET_VALUE=gridmat -END - - -;---------------------------------------------------------------------------- -PRO IN_LAND2,x,y,in -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON COAST, coastxy,coastl,coastnp,GSHHSPoly,GSHHSPoint,GSHHSPoly2,GSHHSPoint2 - TOTANGLE=0. - in=0 - - taille=SIZE(GSHHSPoly) - Npoly=taille(1)-1 - in=0 - FOR I=0L,Npoly-1 DO BEGIN - NP=GSHHSPoly(I+1,0)-GSHHSPoly(I,0) - XX=GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,0) - YY=GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,1) - PNPOLY,X,Y,XX,YY,NP,INOUT - IF INOUT EQ 1 THEN in =1 - ENDFOR - RETURN -END - -;---------------------------------------------------------------------------- -PRO PNPOLY,PX,PY,XX,YY,N,INOUT -; -; Test if point PX PY is inside or outside of polygon -; - X=XX(*)-PX - Y=YY(*)-PY - INOUT=-1 - I=0L - WHILE (I LT N-1) DO BEGIN - J=1L+(I MOD N) - MX=X(I) GE 0.0 - NX=X(J) GE 0.0 - MY=Y(I) GE 0.0 - NY=Y(J) GE 0.0 - ; PRINT,'PNPOLY2:',N,I,J,X(I),X(J),Y(I),Y(J),MX,NX,MY,NY -; IF(.NOT.((MY.OR.NY) AND (MX.OR.NX)).OR.(MX AND NX)) - IF( NOT ((MY OR NY) AND (MX OR NX)) OR (MX AND NX)) THEN BEGIN - I=I+1L - ENDIF ELSE BEGIN - ; PRINT,'PNPOLY3:',I,MX,NX,MY,NY - - IF( NOT (MY AND NY AND (MX OR NX) AND NOT (MX AND NX))) THEN BEGIN - INOUT=-INOUT - RETURN - ENDIF ELSE BEGIN - RAT=((Y(I)*X(J)-X(I)*Y(J))/(X(J)-X(I))) - ; PRINT,'PNPOLY4:',I,RAT - IF RAT EQ 0 THEN BEGIN - INOUT=0 ; zero - RETURN - ENDIF ELSE BEGIN - IF RAT LT 0 THEN BREAK ELSE $ - INOUT=-INOUT ;positive - I=I+1L - ENDELSE - ENDELSE - - ENDELSE - ENDWHILE - RETURN - END - -;---------------------------------------------------------------------------- -PRO IN_SEA,x,y,in -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline - TOTANGLE=0. - J0=contourline(0,0) - in=0 - FOR J=contourline(0,0),contourline(1,0) DO BEGIN - J1=J - J2=J+1 - IF J2 GT contourline(1,0) THEN J2 =J0 - IF (contourline(2+J2-contourline(0,0),1) LT 0) THEN BEGIN - J2=J0 - J0=J+1 - ENDIF - x1=gridmat(0,J1) - y1=gridmat(1,J1) - x2=gridmat(0,J2) - y2=gridmat(1,J2) - ANGLE=ASIN(((x1-x)*(y2-y)-(x2-x)*(y1-y))/sqrt(((x1-x)^2+(y1-y)^2)*((x2-x)^2+(y2-y)^2))) - TOTANGLE=TOTANGLE+ANGLE - ; IF (I EQ 1572) THEN PRINT,'TRIN ?',I,nsea,J,J1,J2,xg,yg,TOTANGLE,ANGLE,2*!pi - ; PRINT,'TRIN ?',J,TOTANGLE - ENDFOR - IF ABS(TOTANGLE-2*!pi) LT !pi THEN in=1 - RETURN -END - -;---------------------------------------------------------------------------- -PRO IN_SEA2,x,y,in -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline - TOTANGLE=0. - ncont=contourline(1,0)-contourline(0,0)+2 - DJM=FLOOR(ncont/100); - PRINT,DJM - J0=contourline(0,0) - in=0 - ANGLE=1 - J=contourline(0,0) - WHILE (J LT contourline(1,0)) DO BEGIN - J1=J - DJMAX=MIN([DJM,MAX([1,FLOOR(1/ABS(ANGLE))])]) - DJ=1 - IND=2+J+DJ-contourline(0,0) - ;PRINT,2+J+DJ-contourline(0,0),ncont,'##',size(contourline) - IF (IND LT ncont) THEN BEGIN - WHILE ((IND LT ncont) AND (contourline(IND,1) EQ 1) AND (DJ LT DJMAX)) DO BEGIN - DJ=DJ+1 - IND=2+J+DJ-contourline(0,0) - ENDWHILE - ENDIF - J2=J1+DJ - IF J2 GT contourline(1,0) THEN J2 =J0 - IF (contourline(2+J2-contourline(0,0),1) EQ 0) THEN BEGIN - J2=J0 - J0=J+1 - ENDIF - x1=gridmat(0,J1) - y1=gridmat(1,J1) - x2=gridmat(0,J2) - y2=gridmat(1,J2) - ANGLE=ASIN(((x1-x)*(y2-y)-(x2-x)*(y1-y))/sqrt(((x1-x)^2+(y1-y)^2)*((x2-x)^2+(y2-y)^2))) - TOTANGLE=TOTANGLE+ANGLE - J=J+DJ - ENDWHILE - IF ABS(TOTANGLE-2*!pi) LT !pi THEN in=1 - RETURN -END - -;---------------------------------------------------------------------------- -PRO GET_BOUNDARY, IOBP, NEIGHBOR -; looks for points on the boundary ... -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -; Licensing: -; -; This code is distributed under the GNU LGPL license. -; -; Written: -; -; Sometime in 2011 -; Adapted to IDL, by F. Ardhuin 22 June 2013 -; THERE SEEMS TO BE A BUG ... -; -; Author: -; -; Mathieu Dutour Sikiric -; -; Parameters: -; Input: -; NNGP: number of nodes -; TRIGP: list of nodes -; NTRI: number of triangles -; Output: -; IOBP: Boundary Points -; NEIGHBOR -; -; Description: -; if a node belong to a boundary, the function -; returns the neighbor of this point on one side. -; if the point is interior then the value 0 is set. -; - IE=0 - I=0 - OP=0 - - STATUS=INTARR(NNGP) - COLLECTED=INTARR(NNGP) - PREVVERT=INTARR(NNGP) - NEXTVERT=INTARR(NNGP) - NEIGHBOR=INTARR(NNGP) - NEIGHBOR(*)=0 - STATUS(*) = 0 - NEXTVERT(*) = 0 - PREVVERT(*) = 0 - FOR IE=1,NTRI DO BEGIN - FOR I=1,3 DO BEGIN - IF (I EQ 1) THEN BEGIN - IPREV=3 - ENDIF ELSE BEGIN - IPREV=I-1 - ENDELSE - IF (I EQ 3) THEN BEGIN - INEXT=1 - ENDIF ELSE BEGIN - INEXT=I+1 - ENDELSE - IP=TRIGP(IE,I) - IPNEXT=TRIGP(IE,INEXT) - IPPREV=TRIGP(IE,IPREV) - IF (STATUS(IP-1) EQ 0) THEN BEGIN - STATUS(IP-1)=1 - PREVVERT(IP-1)=IPPREV - NEXTVERT(IP-1)=IPNEXT - ENDIF - ENDFOR - ENDFOR - STATUS(*)=0 - - ISFINISHED=0 - WHILE ISFINISHED EQ 0 DO BEGIN - COLLECTED(*)=0 - FOR IE=1,NTRI DO BEGIN - FOR I=1,3 DO BEGIN - IF (I EQ 1) THEN BEGIN - IPREV=3 - ENDIF ELSE BEGIN - IPREV=I-1 - ENDELSE - IF (I EQ 3) THEN BEGIN - INEXT=1 - ENDIF ELSE BEGIN - INEXT=I+1 - ENDELSE - IP=TRIGP(IE,I) - IPNEXT=TRIGP(IE,INEXT) - IPPREV=TRIGP(IE,IPREV) - IF (STATUS(IP-1) EQ 0) THEN BEGIN - ZNEXT=NEXTVERT(IP-1) - IF (ZNEXT EQ IPPREV) THEN BEGIN - COLLECTED(IP-1)=1 - NEXTVERT(IP-1)=IPNEXT - IF (NEXTVERT(IP-1) EQ PREVVERT(IP-1)) THEN BEGIN - STATUS(IP-1)=1 - ENDIF - ENDIF - ENDIF - ENDFOR - ENDFOR - - ISFINISHED=1 - FOR IP=0,NNGP-1 DO BEGIN - IF ((COLLECTED(IP) EQ 0) AND (STATUS(IP) EQ 0)) THEN BEGIN - STATUS(IP)=-1 - NEIGHBOR(IP)=NEXTVERT(IP) ; new code - ENDIF - IF (STATUS(IP) EQ 0) THEN BEGIN - ISFINISHED=0 - ENDIF - ENDFOR - IF (ISFINISHED EQ 1) THEN BEGIN - ISFINISHED=0 - ENDIF - ENDWHILE - - IOBP(*) = 0 - FOR IP=0,NNGP-1 DO BEGIN - IF (STATUS(IP) EQ -1 AND IOBP(IP) EQ 0) THEN BEGIN - IOBP(IP)=1 - ENDIF - ENDFOR -; Now some basic consistency checks -; The points that are neighbor should be organized in cycles. -; That is every node should be a neighbor and have a neighbor -; and only one - NBneighbor=INTARR(NNGP) - NBneighbor=0 - FOR IP=0,NNGP-1 DO BEGIN - eIdx=NEIGHBOR(IP) - IF (eIdx GT 0) THEN BEGIN - NBneighbor(eIdx)=NBneighbor(eIdx)+1 - ENDIF - ENDFOR - HaveError=0 - FOR IP=0,NNGP-1 DO BEGIN - IF (NBneighbor(IP) GT 1) THEN BEGIN - Print , 'Inconsistency in the output' - Print , ' Vertex ', IP, ' is ', NBneighbor(IP), ' times neighbor' - HaveError=1 - ENDIF - IF ((NBneighbor(IP) EQ 1) AND (NEIGHBOR(IP) EQ 0)) THEN BEGIN - Print , 'Inconsistency in the output' - Print , ' Vertex ', IP, ' is a neighbor' - Print , ' but has no neighbor!' - HaveError=1 - ENDIF - IF ((NBneighbor(IP) EQ 0) AND (NEIGHBOR(IP) GT 0)) THEN BEGIN - Print , 'Inconsistency in the output' - Print , ' Vertex ', IP, ' has a neighbor' - Print , ' but is not a neighbor!' - HaveError=1 - ENDIF - ENDFOR - IF (HaveError EQ 1) THEN BEGIN - Print , 'Find some errors in the output' - Print , 'Please check for node contained in several boundaries' - ENDIF - RETURN - END - -;********************************************************************** -;* * -;********************************************************************** - PRO GetCycleBoundaries, IOBP, NEIGHBOR, NbCycle, LengthCycle, FirstInCycle, StatusCycle -; Licensing: -; -; This code is distributed under the GNU LGPL license. -; -; Written: -; -; Sometime in 2011 -; -; Author: -; -; Mathieu Dutour Sikiric -; -; Parameters: -; Input: -; NNGP: number of nodes -; TRIGP: list of nodes -; NTRI: number of triangles -; IOBP: List of Boundary Points -; NEIGHBOR: neighbor of a point. -; -; Output: -; NbCycle -; LengthCycle: list of length of cycles -; FirstInCycle: First element in the cycle -; StatusCycle: For every element specification to which -; cycle it belongs -; - STATUS=INTARR(NNGP) - LengthCycle=INTARR(NNGP) - FirstInCycle=INTARR(NNGP) - StatusCycle=INTARR(NNGP) - STATUS(*) = 0 - FOR IP=0,NNGP-1 DO BEGIN - IF (IOBP(IP) EQ 1) THEN STATUS(IP)=1 - ENDFOR - - NbCycle = 0 - FOR IP = 0, NNGP-1 DO BEGIN - IF (STATUS(IP) EQ 1) THEN BEGIN - NbCycle=NbCycle+1 - IPfirst=IP - IPwork=IP - FINISHED=0 - WHILE FINISHED EQ 0 DO BEGIN - IF (IPwork EQ 0) THEN FINISHED=1 - IF (FINISHED EQ 0) THEN BEGIN - STATUS(IPwork) = 0 - IPwork=NEIGHBOR(IPwork) - IF (IPwork EQ IPfirst) THEN BEGIN - FINISHED = 1 - ENDIF - ENDIF - ENDWHILE - ENDIF - ENDFOR - - FOR IP=0,NNGP-1 DO BEGIN - IF (IOBP(IP) EQ 1) THEN STATUS(IP) = 1 - ENDFOR - - iCycle=0 - FOR IP=0,NNGP-1 DO BEGIN - IF (STATUS(IP) EQ 1) THEN BEGIN - iCycle=iCycle+1 - IPfirst=IP - FirstInCycle(iCycle)=IPfirst - IPwork=IP - TheLength=0 - FINISHED=0 - WHILE (FINISHED EQ 0) DO BEGIN - IF (IPwork EQ 0) THEN FINISHED = 1 - IF (FINISHED EQ 0) THEN BEGIN - STATUS(IPwork)=0 - TheLength=TheLength+1 - StatusCycle(IPwork)=iCycle - IPwork=NEIGHBOR(IPwork) - IF (IPwork EQ IPfirst) THEN FINISHED = 1 - ENDIF - ENDWHILE - LengthCycle(iCycle) = TheLength - ENDIF - ENDFOR - RETURN - END - -;---------------------------------------------------------- -PRO MESH_CLEAN_4,IPDEL -; Removes node and triangles with 4 neighbors -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON WGene,Wgrideditor,WG,root -;*******END OF COMMON BLOCKS******************************* -; - TRIGP_OLD=TRIGP(*,1:3) - indtri=WHERE(TRIGP_OLD EQ IPDEL,kount) - - IF (kount EQ 4) THEN BEGIN - PRINT,'Cleaning up 4-neighbor node:',IPDEL - FOR ITRI=0,kount-1 DO BEGIN - ;ind1 = ARRAY_INDICES(TRIGP_OLD, indtri(ITRI)) - ARRAY_IND2,TRIGP_OLD, indtri(ITRI),ind1 - PRINT,'Node ', IPDEL,' is in element', ind1(0),ind1(1),TRANSPOSE(TRIGP_OLD(ind1(0),*)) - ENDFOR - - TRI2=INDGEN(3)*0 - ;ind1 = ARRAY_INDICES(TRIGP_OLD, indtri(0)) - ;ind1 = ARRAY_IND2(TRIGP_OLD, indtri(0)) - ARRAY_IND2,TRIGP_OLD, indtri(0),ind1 - ind12=((ind1(1)+1) MOD 3)+1 - ind13=((ind1(1)+2) MOD 3)+1 - - FOR ITRI=1,kount-1 DO BEGIN - ;indn = ARRAY_INDICES(TRIGP_OLD, indtri(ITRI)) - ;indn = ARRAY_IND2(TRIGP_OLD, indtri(ITRI)) - ARRAY_IND2,TRIGP_OLD, indtri(ITRI),indn - indn2=((indn(1)+1) MOD 3)+1 - indn3=((indn(1)+2) MOD 3)+1 -; looks for other common point of 2 triangles - ;PRINT,'1', TRI2(ITRI-1),indn(0),indn(1),indn2,indn3,TRIGP_OLD(indn(0),*) - IF ( TRIGP(indn(0),indn2) EQ TRIGP(ind1(0),ind12)) THEN TRI2(ITRI-1)=1 - ; PRINT,'2', TRI2(ITRI-1),indn(0),indn(1),indn2,indn3,TRIGP_OLD(indn(0),*) - IF ( TRIGP(indn(0),indn3) EQ TRIGP(ind1(0),ind12)) THEN TRI2(ITRI-1)=1 - ;PRINT,'3', TRI2(ITRI-1),indn(0),indn(1),indn2,indn3,TRIGP_OLD(indn(0),*) - IF ( TRIGP(indn(0),indn2) EQ TRIGP(ind1(0),ind13)) THEN TRI2(ITRI-1)=1 - ;PRINT,'4', TRI2(ITRI-1),indn(0),indn(1),indn2,indn3,TRIGP_OLD(indn(0),*) - IF ( TRIGP(indn(0),indn3) EQ TRIGP(ind1(0),ind13)) THEN TRI2(ITRI-1)=1 - IF (TRI2(ITRI-1) EQ 0) THEN BEGIN - ind2 = indn ; this is the opposite triangle - ind22=indn2 - ind23=indn3 - ENDIF - ;PRINT,'C_GP IN', ITRI-1,TRI2(ITRI-1),indn(0),indn(1),indn2,indn3,TRIGP_OLD(indn(0),*) - ENDFOR -; looks for opposite nodes -; assumes that ind22 and ind12 are opposite - FLIP=0 - FOUND=0 - FOR ITRI=1,kount-1 DO BEGIN - ;indn = ARRAY_INDICES(TRIGP_OLD, indtri(ITRI)) - ;indn = ARRAY_IND2(TRIGP_OLD, indtri(ITRI)) - ARRAY_IND2,TRIGP_OLD, indtri(ITRI),indn - IF (indn(0) NE ind2(0)) THEN BEGIN - indn2=((indn(1)+1) MOD 3)+1 - indn3=((indn(1)+2) MOD 3)+1 - IF ( TRIGP(indn(0),indn2) EQ TRIGP(ind1(0),ind12) $ - AND TRIGP(indn(0),indn3) EQ TRIGP(ind2(0),ind22)) THEN FLIP=1 - IF (FOUND EQ 0) THEN BEGIN - ind3=indn - FOUND=1 - ENDIF ELSE BEGIN - ind4=indn - ENDELSE - - ENDIF - ENDFOR - IF (FLIP EQ 1) THEN BEGIN - temp=ind22 - ind22=ind23 - ind23=temp - ENDIF - print,'Removing node in triangles:' - print,'node ',IPDEL,TRIGP_OLD(ind1(0),ind1(1)),' in tri. ',ind1(0), $ - ' replaced by ', TRIGP_OLD(ind2(0),ind23-1) - TRIGP_OLD(ind1(0),ind1(1))=TRIGP_OLD(ind2(0),ind23-1) - print,'node ',IPDEL,TRIGP_OLD(ind2(0),ind2(1)),' in tri. ',ind2(0), $ - ' replaced by ', TRIGP_OLD(ind1(0),ind13-1) - TRIGP_OLD(ind2(0),ind2(1))=TRIGP_OLD(ind1(0),ind13-1) -; - print,'Removing triangles:',ind3(0),' and ',ind4(0) - NTRI=NTRI-2 - temp3=ind3 - temp4=ind4 - IF (ind3(0) GT ind4(0)) THEN BEGIN - ind4=temp3 - ind3=temp4 - ENDIF - - TRIGP=LONARR(ntri+1,4) - TRIGP(0:ind3(0)-1,1:3)=TRIGP_OLD(0:ind3(0)-1,0:2) - TRIGP(ind3(0):ind4(0)-2,1:3)=TRIGP_OLD(ind3(0)+1:ind4(0)-1,0:2) - TRIGP(ind4(0)-1:ntri,1:3)=TRIGP_OLD(ind4(0)+1:ntri+2,0:2) - - - FOR ITRI=1,NTRI DO BEGIN - FOR II=1,3 DO BEGIN - I1=TRIGP(ITRI,II) - IF (I1 GE IPDEL) THEN TRIGP(ITRI,II)=TRIGP(ITRI,II)-1 - ENDFOR - ENDFOR - - idel= 1;number of deleted grid points - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,IPDEL-1,5,IPDEL-1] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF IPDEL gt 1 THEN gridmat(*,0:IPDEL-2)=tempo(*,0:IPDEL-2) - IF IPDEL LT nngp THEN gridmat(*,IPDEL-1:nngp-1)=tempo(*,IPDEL:nngp) - MAKE_CONTOUR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - PRINT,'Point ',IPDEL,' has been deleted.' - - ENDIF ; kount = 4 - - RETURN - END - -;---------------------------------------------------------- -PRO MESH_CLEAN_3,IPDEL -; Removes node and triangles with 3 neighbors (no boundary) -; Only if angle of remaining triangle is less than ANGMAX -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON WGene,Wgrideditor,WG,root -;*******END OF COMMON BLOCKS******************************* -; - TRIGP_OLD=TRIGP(*,1:3) - indtri=WHERE(TRIGP_OLD EQ IPDEL,kount) - PRINT,'Removing node with 3 neighbors?',IPDEL,kount - - IF (kount EQ 3) THEN BEGIN - - FOR ITRI=0,kount-1 DO BEGIN - ARRAY_IND2,TRIGP_OLD, indtri(ITRI),ind1 - PRINT,'C_GP IN', ind1(0),ind1(1),TRANSPOSE(TRIGP_OLD(ind1(0),*)) - ;PRINT,'bound? ', IOBP(TRANSPOSE(TRIGP_OLD(ind1(0),*))-1) - ;SUMIOBP=SUMIOBP+TOTAL(IOBP(TRANSPOSE(TRIGP_OLD(ind1(0),*))-1)) - ENDFOR - - ARRAY_IND2,TRIGP_OLD, indtri(0),ind1 - ARRAY_IND2,TRIGP_OLD, indtri(1),ind2 - ARRAY_IND2,TRIGP_OLD, indtri(2),ind3 - - - temp1=ind1 - temp2=ind2 - IF (ind1(0) GT ind2(0)) THEN BEGIN - ind2=temp1 - ind1=temp2 - ENDIF - temp1=ind1 - temp3=ind3 - IF (ind1(0) GT ind3(0)) THEN BEGIN - ind3=temp1 - ind1=temp3 - ENDIF - ind12=((ind1(1)+1) MOD 3) - ind13=((ind1(1)+2) MOD 3) - ind22=((ind2(1)+1) MOD 3) - ind23=((ind2(1)+2) MOD 3) - ind32=((ind3(1)+1) MOD 3) - ind33=((ind3(1)+2) MOD 3) - ind2n=ind22 -; Finds node to be used for replacement - IF (TRIGP_OLD(ind2(0),ind22) EQ TRIGP_OLD(ind1(0),ind12) OR $ - TRIGP_OLD(ind2(0),ind22) EQ TRIGP_OLD(ind1(0),ind13) ) THEN ind2n=ind23 - - ind1c=ind12 - ind1a=ind13 - - - print,'Removing node in triangles:' - print,'node ',IPDEL,' in triangle ',ind1(0), $ - ' replaced by', TRIGP_OLD(ind2(0),ind2n) - TRIGP_OLD(ind1(0),ind1(1))=TRIGP_OLD(ind2(0),ind2n) -; - print,'Removing triangles:',ind2(0),ind3(0) - - NTRI=NTRI-2 - TRIGP=LONARR(ntri+1,4) - TRIGP(0:ind2(0)-1,1:3)=TRIGP_OLD(0:ind2(0)-1,0:2) - TRIGP(ind2(0):ind3(0)-2,1:3)=TRIGP_OLD(ind2(0)+1:ind3(0)-1,0:2) - TRIGP(ind3(0)-1:ntri,1:3)=TRIGP_OLD(ind3(0)+1:ntri+2,0:2) -; -; Shifts indices in remaining triangles -; - FOR ITRI=1,NTRI DO BEGIN - FOR II=1,3 DO BEGIN - I1=TRIGP(ITRI,II) - IF (I1 GE IPDEL) THEN TRIGP(ITRI,II)=TRIGP(ITRI,II)-1 - ENDFOR - ENDFOR - - idel= 1;number of deleted grid points - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,IPDEL-1,5,IPDEL-1] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF IPDEL gt 1 THEN gridmat(*,0:IPDEL-2)=tempo(*,0:IPDEL-2) - IF IPDEL LT nngp THEN gridmat(*,IPDEL-1:nngp-1)=tempo(*,IPDEL:nngp) - MAKE_CONTOUR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - PRINT,'Point ',IPDEL,' has been deleted.' - - ENDIF ; kount = 3 - RETURN - END - - -;---------------------------------------------------------- -PRO MESH_CLEAN_2,IPDEL,ANGMAX, DELOK -; Removes node and triangles with 2 neighbors -; Only if angle of remaining triangle is less than ANGMAX -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON WGene,Wgrideditor,WG,root -COMMON UNDO,gridmat0,nngp0,ntri0,trigp0,contourline0 - -;*******END OF COMMON BLOCKS******************************* -; - TRIGP_OLD=TRIGP(*,1:3) - indtri=WHERE(TRIGP_OLD EQ IPDEL,kount) - PRINT,'Removing boundary node with 3 neighbors?',IPDEL,kount,ntri0,ntri - - IF (kount EQ 2) THEN BEGIN - - FOR ITRI=0,kount-1 DO BEGIN - ;ind1 = ARRAY_INDICES(TRIGP_OLD, indtri(ITRI)) - ;ind1 = ARRAY_IND2(TRIGP_OLD, indtri(ITRI)) - ARRAY_IND2,TRIGP_OLD, indtri(ITRI),ind1 - PRINT,'C_GP IN', ind1(0),ind1(1),TRANSPOSE(TRIGP_OLD(ind1(0),*)) - ;PRINT,'bound? ', IOBP(TRANSPOSE(TRIGP_OLD(ind1(0),*))-1) - ;SUMIOBP=SUMIOBP+TOTAL(IOBP(TRANSPOSE(TRIGP_OLD(ind1(0),*))-1)) - ENDFOR - - ;ind1 = ARRAY_INDICES(TRIGP_OLD, indtri(0)) - ;ind2 = ARRAY_INDICES(TRIGP_OLD, indtri(1)) - ;ind1 = ARRAY_IND2(TRIGP_OLD, indtri(0)) - ;ind2 = ARRAY_IND2(TRIGP_OLD, indtri(1)) -ARRAY_IND2,TRIGP_OLD, indtri(0),ind1 -ARRAY_IND2,TRIGP_OLD, indtri(1),ind2 - temp1=ind1 - temp2=ind2 - IF (ind1(0) GT ind2(0)) THEN BEGIN - ind2=temp1 - ind1=temp2 - ENDIF - ind12=((ind1(1)+1) MOD 3) - ind13=((ind1(1)+2) MOD 3) - ind22=((ind2(1)+1) MOD 3) - ind23=((ind2(1)+2) MOD 3) - ind2n=ind22 - ind1c=ind12 - ind1a=ind13 -; looks for other non-common point of triangle # 2, will be new point of triangle #1 - IF ( TRIGP_OLD(ind2(0),ind22) EQ TRIGP_OLD(ind1(0),ind12)) THEN BEGIN - ind2n=ind23 - ind1c=ind12 - ind1a=ind13 - ENDIF - IF ( TRIGP_OLD(ind2(0),ind22) EQ TRIGP_OLD(ind1(0),ind13)) THEN BEGIN - ind2n=ind23 - ind1c=ind13 - ind1a=ind12 - ENDIF - IF ( TRIGP_OLD(ind2(0),ind23) EQ TRIGP_OLD(ind1(0),ind12)) THEN BEGIN - ind2n=ind22 - ind1c=ind12 - ind1a=ind13 - ENDIF - IF ( TRIGP_OLD(ind2(0),ind23) EQ TRIGP_OLD(ind1(0),ind13)) THEN BEGIN - ind2n=ind22 - ind1c=ind13 - ind1a=ind12 - ENDIF - - xc=gridmat(0,TRIGP_OLD(ind1(0),ind1c)-1) - yc=gridmat(1,TRIGP_OLD(ind1(0),ind1c)-1) - xa=gridmat(0,TRIGP_OLD(ind1(0),ind1a)-1) - ya=gridmat(1,TRIGP_OLD(ind1(0),ind1a)-1) - xb=gridmat(0,TRIGP_OLD(ind2(0),ind2n)-1) - yb=gridmat(1,TRIGP_OLD(ind2(0),ind2n)-1) - dxa=(xa-xc) - dxb=(xb-xc) - dya=(ya-yc) - dyb=(yb-yc) - d1=sqrt( dxa^2 + dya^2 ) - d2=sqrt( dxb^2 + dyb^2 ) - SIA = (dxa*dyb-dxb*dya) - COA = (dxa*dxb+dya*dyb) - ANGLE=ABS(ATAN(SIA,COA)/!dtor) - IF (ANGLE LT ANGMAX) THEN BEGIN - print,'Removing node in triangles:' - print,'node ',IPDEL,ANGLE,d1,d2,'in tri. ',ind1(0), $ - ' replaced by', TRIGP_OLD(ind2(0),ind2n) - TRIGP_OLD(ind1(0),ind1(1))=TRIGP_OLD(ind2(0),ind2n) -; - print,'Removing triangles:',ind2(0) - NTRI=NTRI-1 - TRIGP=LONARR(ntri+1,4) - TRIGP(0:ind2(0)-1,1:3)=TRIGP_OLD(0:ind2(0)-1,0:2) - IF (ind2(0) LE NTRI) THEN TRIGP(ind2(0):ntri,1:3)=TRIGP_OLD(ind2(0)+1:ntri+1,0:2) -; - FOR ITRI=1,NTRI DO BEGIN - FOR II=1,3 DO BEGIN - I1=TRIGP(ITRI,II) - IF (I1 GE IPDEL) THEN TRIGP(ITRI,II)=TRIGP(ITRI,II)-1 - ENDFOR - ENDFOR - - idel= 1;number of deleted grid points - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,IPDEL-1,5,IPDEL-1] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF IPDEL gt 1 THEN gridmat(*,0:IPDEL-2)=tempo(*,0:IPDEL-2) - IF IPDEL LT nngp THEN gridmat(*,IPDEL-1:nngp-1)=tempo(*,IPDEL:nngp) - MAKE_CONTOUR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - PRINT,'Point ',IPDEL,' has been deleted.' - ENDIF ELSE BEGIN - PRINT,'No removal, angle too large :',ANGLE, ' > ', ANGMAX - DELOK= 0 - ENDELSE - ENDIF ; kount = 2 - RETURN - END - - -;---------------------------------------------------------- -PRO MESH_CLEAN_1,IPDEL -; Removes node and triangles with 2 neighbors -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON WGene,Wgrideditor,WG,root -;*******END OF COMMON BLOCKS******************************* -; - - TRIGP_OLD=TRIGP(*,1:3) - indtri=WHERE(TRIGP_OLD EQ IPDEL,kount) - IF (kount EQ 1) THEN BEGIN - PRINT,'Removing node with 2 neighbors:',IPDEL,kount - ARRAY_IND2,TRIGP_OLD, indtri(0),ind1 - ind12=((ind1(1)+1) MOD 3)+1 - ind13=((ind1(1)+2) MOD 3)+1 -; - print,'Removing triangle:',ind1(0) - NTRI=NTRI-1 - TRIGP=LONARR(ntri+1,4) - TRIGP(0:ind1(0)-1,1:3)=TRIGP_OLD(0:ind1(0)-1,0:2) - IF (ind1(0) LT NTRI) THEN TRIGP(ind1(0):ntri,1:3)=TRIGP_OLD(ind1(0)+1:ntri+1,0:2) -; - FOR ITRI=1,NTRI DO BEGIN - FOR II=1,3 DO BEGIN - I1=TRIGP(ITRI,II) - IF (I1 GE IPDEL) THEN TRIGP(ITRI,II)=TRIGP(ITRI,II)-1 - ENDFOR - ENDFOR - - idel= 1;number of deleted grid points - WIDGET_CONTROL,Wgrideditor(1),/DELETE_ROWS , $ - USE_TABLE_SELECT=[-1,IPDEL-1,5,IPDEL-1] - nngp=nngp-idel ;new number of grid points - tempo=gridmat - gridmat=DBLARR(8,nngp) - IF IPDEL gt 1 THEN gridmat(*,0:IPDEL-2)=tempo(*,0:IPDEL-2) - IF IPDEL LT nngp THEN gridmat(*,IPDEL-1:nngp-1)=tempo(*,IPDEL:nngp) - MAKE_CONTOUR - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - Displaygrid - PRINT,'Point ',IPDEL,' has been deleted.' - ENDIF - RETURN - END - - -;---------------------------------------------------------------------------- -PRO MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH -; looks for points on the boundary ... -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -;*******END OF COMMON BLOCKS******************************* - CCON =INTARR(NNGP) - NEIGH=INTARR(NNGP) - IOBP=INTARR(NNGP) - ICOMAX=0 - COUNTRI=0 -; -; Builds neighbor node number array CCON -; - FOR IE = 1 , NTRI DO BEGIN - FOR II=0,2 DO BEGIN - IP = TRIGP(IE,II+1) - CCON(IP-1) = CCON(IP-1) + 1 - IF CCON(IP-1) GT COUNTRI THEN BEGIN - COUNTRI= CCON(IP-1) - ICOMAX=IP - ENDIF - ENDFOR - ENDFOR -; COUNTRI = MAX(CCON) -; -; Builds neighbor triangle number array NEIGH -; - MAXNEIGH=2*COUNTRI - VNEIGH=LONARR(NNGP,MAXNEIGH) - - FOR IE = 1 , NTRI DO BEGIN - FOR II=1,3 DO BEGIN - IP = TRIGP(IE,II) ; node for which data is gathered - FOR I2=0,1 DO BEGIN - IP2 = TRIGP(IE,1+((II+I2) MOD 3)); neighbor of this node - FOUND=0 - FOR INEI =0, NEIGH(IP-1)-1 DO BEGIN - IF ((IP2-1) EQ VNEIGH(IP-1,INEI)) THEN FOUND = 1 - ENDFOR - IF (FOUND EQ 0) THEN BEGIN - VNEIGH(IP-1,NEIGH(IP-1)) = IP2-1 - NEIGH(IP-1)=NEIGH(IP-1)+1 - ENDIF - ENDFOR - ENDFOR - ENDFOR -; -; Compares the 2 arrays -; - FOR IX = 0, NNGP-1 DO BEGIN - IF (CCON(IX) LT NEIGH(IX)) THEN IOBP(IX)=1 ELSE IOBP(IX)=0 - ENDFOR - RETURN -END - -;---------------------------------------------------------------------------- -PRO MSH_BOUNDARY1,IP1,IOBP -; looks for points on the boundary ... -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -;*******END OF COMMON BLOCKS******************************* - CCON =0 - IOBP =0 - NEIGH=0 -; -; Builds neighbor triangle number array NEIGH and CCON -; - MAXNEIGH=20 - VNEIGH=LONARR(MAXNEIGH) - - FOR IE = 1 , NTRI DO BEGIN - FOR II=1,3 DO BEGIN - IP = TRIGP(IE,II) ; node for which data is gathered - IF (IP EQ IP1+1) THEN BEGIN - CCON = CCON +1 - FOR I2=0,1 DO BEGIN - IP2 = TRIGP(IE,1+((II+I2) MOD 3)); neighbor of this node - FOUND=0 - FOR INEI =0, NEIGH-1 DO BEGIN - IF (IP2 EQ VNEIGH(INEI)) THEN FOUND = 1 - ENDFOR - IF (FOUND EQ 0) THEN BEGIN - VNEIGH(NEIGH) = IP2 - NEIGH=NEIGH+1 - ENDIF - ENDFOR - ENDIF - ENDFOR - ENDFOR -; -; Compares the 2 values -; - IF (CCON LT NEIGH ) THEN IOBP=1 ELSE IOBP=0 - RETURN -END - -;---------------------------------------------------------- -PRO DISPERSION,SIG,DEP,WCG -; Inverts dispersion -; inverts the linear dispersion relation (2*pi*f)^2=g*k*tanh(k*dep) to get -; k from f and dep. 2 Arguments: f and dep. -eps=0.000001; -g=9.81; - NDEP=N_ELEMENTS(DEP) - WCG=FLTARR(NDEP) - FOR I=0,NDEP-1 DO BEGIN - Y=dep(I)*sig^2./g ; this is the squared adimensional frequency - X=sqrt(Y); - F=1.; - while abs(F) GT eps DO BEGIN - H=tanh(X); - F=Y-X*H; - FD=-H-X/cosh(X)^2; - X=X-F/FD; - endWHILE - WNUM = X/DEP(I) - WCG(I)=SIG/WNUM*(0.5+X/SINH(2*X)) - ;PRINT,'TEST:',I,DEP(I),WCG(I),Y,X*TANH(X) - ENDFOR -RETURN -END - -;---------------------------------------------------------- -PRO UPDATE_TIMESTEPS -; Recomputes timesteps -; -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -COMMON TRIANGLES,ntri,TRIGP,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER -COMMON TIMESTEPSUG2, CCON, IEN, SI, AREA, WCG, CELLVERTEX, IE_CELL, POS_CELL, C, K -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -;*******END OF COMMON BLOCKS******************************* -; - NTIMESTEPS=MIN([NNGP,200]) - IEN = FLTARR(6,NTRI) - AREA = FLTARR(NTRI) - CCON = INTARR(NNGP) - LEN = FLTARR(NTRI,3) - ANGLE0 = FLTARR(NTRI,3) - CROSSDIFF = FLTARR(6,NTRI) - SI = FLTARR(NNGP) - ONETHIRD=1/3. - ONESIXTH=1/6. - THR=1.E-20 - IF (NNGP GT 15000) THEN message,'Computing time steps for mesh ... please wait',/INFO - MSH_BOUNDARY,IOBP,VNEIGH,MAXNEIGH,NEIGH - - SIRATIO = FLTARR(NNGP)+1/THR - TMPINV = FLTARR(3) - TMP = FLTARR(3) - FOR IE = 0, NTRI-1 DO BEGIN - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - NI = TRIGP(IE+1,*) - DXP1 = gridmat(0,I2) - gridmat(0,I1) - DYP1 = gridmat(1,I2) - gridmat(1,I1) - DXP2 = gridmat(0,I3) - gridmat(0,I2) - DYP2 = gridmat(1,I3) - gridmat(1,I2) - DXP3 = gridmat(0,I1) - gridmat(0,I3) - DYP3 = gridmat(1,I1) - gridmat(1,I3) - IEN(0,IE) = - DYP2 - IEN(1,IE) = DXP2 - IEN(2,IE) = - DYP3 - IEN(3,IE) = DXP3 - IEN(4,IE) = - DYP1 - IEN(5,IE) = DXP1 - - LEN(IE,0) = SQRT(DXP2^2+DYP2^2) - LEN(IE,1) = SQRT(DXP3^2+DYP3^2) - LEN(IE,2) = SQRT(DXP1^2+DYP1^2) - - - TMPINV(0) = 1./ (LEN(IE,1) * LEN(IE,2)) - TMPINV(1) = 1./ (LEN(IE,0) * LEN(IE,2)) - TMPINV(2) = 1./ (LEN(IE,1) * LEN(IE,0)) - - TMP(0) = -1.*(DXP1*DXP3 +DYP1*DYP3) * TMPINV(0) - TMP(1) = -1.*(DXP2*DXP1 +DYP2*DYP1) * TMPINV(1) - TMP(2) = -1.*(DXP3*DXP2 +DYP3*DYP2) * TMPINV(2) -; -; angles used in gradients computation -; normalizes angles (OK if not on boundary) -; - ANGLE0(IE,0) = ACOS(TMP(0))/(2*!pi) - ANGLE0(IE,1) = ACOS(TMP(1))/(2*!pi) - ANGLE0(IE,2) = ACOS(TMP(2))/(2*!pi) - -; -; cross product of edge-vector (orientated anticlockwise) -; - AREA(IE) = (DXP3*DYP1 - DYP3*DXP1)*0.5 - -; The *1 factor is for km -> km -; For lat-lon calculations, there should also be the 1/cos(lat) in -; FACTX - - FACTX = 1./(2*AREA(IE)*1) - FACTY = 1./(2*AREA(IE)*1) - - CROSSDIFF(0,IE) = -1*DYP2 * FACTX - CROSSDIFF(1,IE) = -1*DYP3 * FACTX - CROSSDIFF(2,IE) = -1*DYP1 * FACTX - CROSSDIFF(3,IE) = DXP2 * FACTY - CROSSDIFF(4,IE) = DXP3 * FACTY - CROSSDIFF(5,IE) = DXP1 * FACTY - - CCON(I1) = CCON(I1)+1 - SI(I1) = SI(I1) + AREA(IE)*ONETHIRD - CCON(I2) = CCON(I2)+1 - SI(I2) = SI(I2) + AREA(IE)*ONETHIRD - CCON(I3) = CCON(I3)+1 - SI(I3) = SI(I3) + AREA(IE)*ONETHIRD - IF (AREA(IE) LT SIRATIO(I1)) THEN SIRATIO(I1) = AREA(IE) - IF (AREA(IE) LT SIRATIO(I2)) THEN SIRATIO(I2) = AREA(IE) - IF (AREA(IE) LT SIRATIO(I3)) THEN SIRATIO(I3) = AREA(IE) - ENDFOR - SIGMA = 8.d0*ATAN(1.d0)/WAVEPERIOD - - DEPTHS= gridmat(7,*) + zoffset - - DISPERSION,SIGMA,DEPTHS,WCG - - maxmnecon = MAX(CCON) - CELLVERTEX=LONARR(NNGP,maxmnecon,2) - - CHILF = LONARR(NNGP)-1 - FOR IE = 0, NTRI-1 DO BEGIN - FOR J=1,3 DO BEGIN - I = TRIGP(IE+1,J)-1 - CHILF(I) = CHILF(I)+1 - CELLVERTEX(I,CHILF(I),0) = IE - CELLVERTEX(I,CHILF(I),1) = J-1 - ENDFOR - ENDFOR - - J = 0L - JCELLS=LONARR(NNGP) - FOR IP = 0, NNGP-1 DO BEGIN - JCELLS(IP)=J - FOR I = 0, CCON(IP)-1 DO BEGIN - J = J + 1 - ENDFOR - ENDFOR - - COUNT_MAX = J ; Max. Number of entries in the pointers used in the calculations - - IE_CELL=LONARR(COUNT_MAX) - POS_CELL=INTARR(COUNT_MAX) -; - J = -1L - FOR IP = 0, NNGP-1 DO BEGIN - FOR I = 0, CCON(IP)-1 DO BEGIN - J = J + 1 - IE_CELL(J) = CELLVERTEX(IP,I,0) - POS_CELL(J) = CELLVERTEX(IP,I,1) - ENDFOR - ENDFOR - - DTMAX_EXP = FLTARR(NNGP) + 1./THR - - NTH=24 - THETA=FINDGEN(NTH)*2*!pi/NTH - COSTH=COS(THETA) - SINTH=SIN(THETA) - C = FLTARR(2,NNGP) - K = FLTARR(3,NTRI) - - LATTOM = 1000. ; !dtor * 6378137.0d0 - LAMBDA = FLTARR(2) -; -; Loops on directions -; -; IP0=70 -; GET_LUN,unit -; OPENW,unit,'fort.996' - FOR ID = 0, NTH-1 DO BEGIN - - FOR IP = 0, NNGP-1 DO BEGIN - COSFAC = 1. ;COS((FLOAT(gridmat(2,IP))+gridmat(3,IP)/60.)*!dtor) - C(0,IP) = WCG(IP)*COSTH(ID)/(LATTOM*COSFAC) - C(1,IP) = WCG(IP)*SINTH(ID)/LATTOM -; IF (IP EQ 70) PRINTF,unit,FORMAT='(2I8,2F13.4,2F11.6,F8.2,3F13.4)', ID+1,IP+1,WCG(IP)*COSTH(ID), WCG(IP)*SINTH(ID), C(0,IP),C(1,IP),WCG(IP), $ -; gridmat(4,IP)+gridmat(5,IP)/60.,gridmat(2,IP)+gridmat(3,IP)/60.,DEPTHS(IP) - ENDFOR - FOR IE = 0, NTRI-1 DO BEGIN - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - LAMBDA(0) = ONESIXTH * (C(0,I1)+C(0,I2)+C(0,I3)) - LAMBDA(1) = ONESIXTH * (C(1,I1)+C(1,I2)+C(1,I3)) - K(0,IE) = LAMBDA(0) * IEN(0,IE) + LAMBDA(1) * IEN(1,IE) - K(1,IE) = LAMBDA(0) * IEN(2,IE) + LAMBDA(1) * IEN(3,IE) - K(2,IE) = LAMBDA(0) * IEN(4,IE) + LAMBDA(1) * IEN(5,IE) -;IF (I1 EQ IP0 OR I2 EQ IP0 OR I3 EQ IP0) THEN PRINTF,unit,FORMAT='(5I8,6F9.5,7F16.8)', $ -; ID+1,I1+1,I2+1,I3+1,IE+1,IEN(0:5,IE),LAMBDA(*),K(*,IE),COSTH(ID),SINTH(ID) -;IF (I1 EQ IP0 OR I2 EQ IP0 OR I3 EQ IP0) THEN PRINTF,unit,FORMAT='(8I6,8F16.8)', $ -; ID+1,I1+1,I2+1,I3+1,IE+1,I1,I2,I3,LAMBDA(*),K(*,IE),C(0,I1),C(0,I2),C(0,I3) - ENDFOR - - J = -1L - FOR IP = 0, NNGP-1 DO BEGIN - KSUM = 0.0 - FOR I = 0, CCON(IP)-1 DO BEGIN - J = J + 1 - IE = IE_CELL(J) - POS = POS_CELL(J) - KSUM = KSUM + MAX([K(POS,IE),0.0]) - I1 = TRIGP(IE+1,1) - I2 = TRIGP(IE+1,2) - I3 = TRIGP(IE+1,3) -; IF (IP EQ IP0) THEN printf,unit,FORMAT='(9I6,6F14.9)',ID+1,IP+1,I+1,J+1,IE+1,POS+1,I1,I2,I3,K(POS,IE),KSUM - ENDFOR - DTMAX_EXP_LOCAL = SI(IP)/MAX([DOUBLE(10.E-10),KSUM]) -; IF (IP.EQ.392) WRITE(997,'(2I8,5F16.9)') ID,IP,SI(IP),WCG(IP),MYXYZ(3,IP),KSUM,DTMAX_EXP(IP) - - IF (IOBP(IP) EQ 0) THEN DTMAX_EXP(IP) = MIN([DTMAX_EXP_LOCAL,DTMAX_EXP(IP)]) -; IF (IP EQ IP0) THEN printf,unit,FORMAT='(2I8,6F16.9)', ID+1,IP+1,SI(IP),WCG(IP),GRIDMAT(7,IP),KSUM,DTMAX_EXP_LOCAL,DTMAX_EXP(IP) - ENDFOR - ENDFOR -; close,unit -; free_lun,unit - ORDER=SORT(DTMAX_EXP) - PRINT,'Nodes giving smallest time steps:',ORDER(0:50)+1 - PRINT,'Values of these time steps (s) :',DTMAX_EXP(ORDER(0:50)) - TIMESTEPS=FLTARR(4,NTIMESTEPS) - FOR I=0,NTIMESTEPS-1 DO BEGIN - IND1=ORDER(I) - TIMESTEPS(0,I)=IND1 - TIMESTEPS(1,I)=DTMAX_EXP(IND1) - TIMESTEPS(2,I)=gridmat(0,IND1) - TIMESTEPS(3,I)=gridmat(1,IND1) - ; PRINT,IND1+1, DTMAX_EXP(IND1), gridmat(4,IND1)+gridmat(5,IND1)/60.,gridmat(2,IND1)+gridmat(3,IND1)/60.,DEPTHS(IND1) - ENDFOR - FLAGTSTEP=1 - TIMESTEPS_ORDER=ORDER - TIMESTEPS_ALL=DTMAX_EXP - RETURN -END - - -;---------------------------------------------------------- -PRO UG_GRADIENTS,Z,TRIANGLES,kount,WHICHNODE,DIFFX,DIFFY -; Computes gradients at position XP,YP -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON WGene,Wgrideditor,WG,root -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -;*******END OF COMMON BLOCKS******************************* - -; WARNING: CROSSDIFF WAS COMPUTED FROM LAT, LON, NOT FROM X, Y - - DIFFX = 0 - DIFFY = 0 - TMP1=FLTARR(3) - TMP2=FLTARR(3) - FOR IE2 = 0, kount-1 DO BEGIN - IE = TRIANGLES(IE2) - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - - TMP1(*) = CROSSDIFF(0:2, IE) - TMP2(*) = CROSSDIFF(3:5, IE) - - DIFFXTMP = Z(I1)*TMP1(0)+Z(I2)*TMP1(1)+Z(I3)*TMP1(2) - DIFFYTMP = Z(I1)*TMP2(0)+Z(I2)*TMP2(1)+Z(I3)*TMP2(2) -; calculate global gradients via all the connection contributions. - DIFFX = DIFFX + DIFFXTMP * ANGLE0(IE,WHICHNODE(IE2)) - DIFFY = DIFFY + DIFFYTMP * ANGLE0(IE,WHICHNODE(IE2)) - ENDFOR - - RETURN - END -;---------------------------------------------------------- -PRO MESH_OPTIMIZE,IP -; Moves nodes to optimize time steps -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON WGene,Wgrideditor,WG,root -COMMON TIMESTEPSUG2, CCON, IEN, SI, AREA, WCG, CELLVERTEX, IE_CELL, POS_CELL, C, K -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -;*******END OF COMMON BLOCKS******************************* -; - indtri=WHERE(TRIGP EQ IP,kountP) - - ALLNODESP=LONARR(kountP*3) - TRIANGLESP=LONARR(kountP) - FOR ITRI=0,kountP-1 DO BEGIN - ARRAY_IND2,TRIGP, indtri(ITRI),ind1 - ; PRINT,'OPT:',IP,' IN', ind1(0),ind1(1),TRANSPOSE(TRIGP(ind1(0),*)) - ALLNODESP(ITRI*3:ITRI*3+2) = TRANSPOSE(TRIGP(ind1(0),1:3))-1 - TRIANGLESP(ITRI)=ind1(0)-1 - ENDFOR - NODESP =ALLNODESP(UNIQ(ALLNODESP, SORT(ALLNODESP))) - NN=N_ELEMENTS(NODESP) - IND=0 -; -; Finds candidate node IPS for shifting around -; - AREAP=SIRATIO(NODESP) - NOZ=WHERE(AREAP GT 0,kkk) - IF (KKK GT 0) THEN BEGIN - RATIO=SI(NODESP(NOZ))/AREAP(NOZ) - MAXR=MAX(RATIO(NOZ),IND) - IPS=NODESP(NOZ(IND))+1 -; -; Tries to shift IPS around -; - IF (MAXR GT 2) THEN BEGIN - indtri=WHERE(TRIGP EQ IPS,kount) - ALLNODES=LONARR(kount*3) - TRIANGLES=LONARR(kount) - WHICHNODE=LONARR(kount) - FOR ITRI=0,kount-1 DO BEGIN - ARRAY_IND2,TRIGP, indtri(ITRI),ind1 - ; PRINT,'IPS:',IPS,' IN', ind1(0),ind1(1),TRANSPOSE(TRIGP(ind1(0),*)) - ALLNODES(ITRI*3:ITRI*3+2) = TRANSPOSE(TRIGP(ind1(0),1:3))-1 - TRIANGLES(ITRI)=ind1(0)-1 - WHICHNODE(ITRI)=ind1(1)-1 - ENDFOR - NODES1 =ALLNODES(UNIQ(ALLNODES, SORT(ALLNODES))) - INDSORT=SORT(TIMESTEPS_ALL(NODES1)) - NODES=NODES1(INDSORT) -; -; Computes bottom slopes -; - UG_GRADIENTS,GRIDMAT(7,*),TRIANGLES,kount,WHICHNODE,DIFFX,DIFFY - ;PRINT,'GRADIENT:',DIFFX,DIFFY - DIST1=SQRT(SI(IPS-1)) - NG=0.05/SQRT(DIFFX^2+DIFFY^2) - NSHIFT=21 - XSHIFT=(FINDGEN(NSHIFT)-NSHIFT/2)*DIST1*NG - YSHIFT=GRIDMAT(1,IPS-1)+XSHIFT*DIFFX - XSHIFT=GRIDMAT(0,IPS-1)-XSHIFT*DIFFY - X=gridmat(0,NODES) - Y=gridmat(1,NODES) - Triangulate, X, Y, tris, hull - GOODSHIFT=INTARR(NSHIFT) - INPOLY=0 -; checks if shifted position is in shrinked convex hull. - XH=(X(HULL)-GRIDMAT(0,IPS-1))*0.2+GRIDMAT(0,IPS-1) - YH=(Y(HULL)-GRIDMAT(1,IPS-1))*0.2+GRIDMAT(1,IPS-1) - OPLOT,[XH ,XH(0)],[YH, YH(0)],COLOR=0 - FOR IS=0,NSHIFT-1 DO BEGIN - PNPOLY,XSHIFT(IS),YSHIFT(IS),XH,YH,N_ELEMENTS(HULL),TEST - GOODSHIFT(IS)=TEST - ENDFOR - ; Next line is in response to bug ... ? - ; IF (GOODSHIFT(NSHIFT/2) LT 1) THEN GOODSHIFT = -1*GOODSHIFT - INDOK=WHERE(GOODSHIFT EQ 1,kk) - IF (KK GT 1) THEN BEGIN - XSHIFT=XSHIFT(INDOK) - YSHIFT=YSHIFT(INDOK) - OPLOT,XSHIFT,YSHIFT, $ - psym=4,SYMSIZE=1.5,COLOR=0 - PRINT,'Trying to move node ',IPS,' to increase timestep at ',IP - UPDATE_TIMESTEPSIP,IP-1,TRIANGLESP,kountp,IPS-1,TRIANGLES,kount, NODES, XSHIFT,YSHIFT,TSHIFT - ENDIF - ENDIF; end of test on MAXR GT 2 - ENDIF - RETURN - END - -;---------------------------------------------------------- -PRO UPDATE_TIMESTEPSIP,IP0,TRIANGLESP,kountp,IPS,TRIANGLES,kount, NODES, XSHIFT,YSHIFT,TSHIFT -; Recomputes timesteps for node IP at shifted positions -; -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,TRIGP,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER -COMMON TIMESTEPSUG2, CCON, IEN, SI, AREA, WCG, CELLVERTEX, IE_CELL, POS_CELL, C, K -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -;*******END OF COMMON BLOCKS******************************* -; - ONETHIRD=1/3. - ONESIXTH=1/6. - THR=1.E-20 - SIGMA = 8.d0*ATAN(1.d0)/WAVEPERIOD - NTH=24 - THETA=FINDGEN(NTH)*2*!pi/NTH - COSTH=COS(THETA) - SINTH=SIN(THETA) - LATTOM = 1000. ; !dtor * 6378137.0d0 - NN = N_ELEMENTS(NODES) - - gridmemo=gridmat(*,IPS) - NSHIFT=N_ELEMENTS(XSHIFT) - TMIN=TIMESTEPS(0) - NN=N_ELEMENTS(NODES) - -; -; Finds all relevant triangles for SI update -; - ALLTRI=[0] - FOR IND=0,N_ELEMENTS(NODES)-1 DO BEGIN - SI(NODES(IND))=0 - indtri=WHERE(TRIGP EQ NODES(IND)+1,countloc) - FOR ITRI=0,countloc-1 DO BEGIN - ARRAY_IND2,TRIGP, indtri(ITRI),ind1 - ALLTRI=[ALLTRI, ind1(0)-1] - ENDFOR - ENDFOR - UNITRI=ALLTRI(UNIQ(ALLTRI, SORT(ALLTRI))) - - TSTEPS=FLTARR(NN,NSHIFT+1) - FOR ISHIFT = 0, NSHIFT-1 DO BEGIN - gridmat(0,IPS)=XSHIFT(ISHIFT) - gridmat(1,IPS)=YSHIFT(ISHIFT) - -; -; Updates SI array -; - SI(NODES)=0 - FOR IND=1,N_ELEMENTS(UNITRI)-1 DO BEGIN - IE = UNITRI(IND) - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - DXP1 = gridmat(0,I2) - gridmat(0,I1) - DYP1 = gridmat(1,I2) - gridmat(1,I1) - DXP2 = gridmat(0,I3) - gridmat(0,I2) - DYP2 = gridmat(1,I3) - gridmat(1,I2) - DXP3 = gridmat(0,I1) - gridmat(0,I3) - DYP3 = gridmat(1,I1) - gridmat(1,I3) - IEN(0,IE) = - DYP2 - IEN(1,IE) = DXP2 - IEN(2,IE) = - DYP3 - IEN(3,IE) = DXP3 - IEN(4,IE) = - DYP1 - IEN(5,IE) = DXP1 - AREA(IE) = (DXP3*DYP1 - DYP3*DXP1)*0.5 - INDNODE=WHERE(NODES EQ I1,knode) - IF (knode GT 0) THEN SI(NODES(INDNODE)) = SI(NODES(INDNODE)) + AREA(IE)*ONETHIRD - INDNODE=WHERE(NODES EQ I2,knode) - IF (knode GT 0) THEN SI(NODES(INDNODE)) = SI(NODES(INDNODE)) + AREA(IE)*ONETHIRD - INDNODE=WHERE(NODES EQ I3,knode) - IF (knode GT 0) THEN SI(NODES(INDNODE)) = SI(NODES(INDNODE)) + AREA(IE)*ONETHIRD - IF (AREA(IE) LT SIRATIO(I1)) THEN SIRATIO(I1) = AREA(IE) - IF (AREA(IE) LT SIRATIO(I2)) THEN SIRATIO(I2) = AREA(IE) - IF (AREA(IE) LT SIRATIO(I3)) THEN SIRATIO(I3) = AREA(IE) - ENDFOR - - DEPTHS2= gridmat(7,IP0) + ZOFFSET ; Should probably update depths when moving nodes - - DISPERSION,SIGMA,DEPTHS2,WCG2 - WCG(IP0)=WCG2 - -; No update of connectivity - - LAMBDA = FLTARR(2) -; -; Loops on directions -; - DTMAX_EXP = FLTARR(NN)+1./THR - FOR ID = 0, NTH-1 DO BEGIN - -; -; Updates speed at node IP0 -; - FOR IP = 0, NNGP-1 DO BEGIN - COSFAC = 1. ;COS((FLOAT(gridmat(2,IP))+gridmat(3,IP)/60.)*!dtor) - C(0,IP) = WCG(IP)*COSTH(ID)/(LATTOM*COSFAC) - C(1,IP) = WCG(IP)*SINTH(ID)/LATTOM - ENDFOR - - - FOR IND=1,N_ELEMENTS(UNITRI)-1 DO BEGIN - IE = UNITRI(IND) - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - LAMBDA(0) = ONESIXTH * (C(0,I1)+C(0,I2)+C(0,I3)) - LAMBDA(1) = ONESIXTH * (C(1,I1)+C(1,I2)+C(1,I3)) - K(0,IE) = LAMBDA(0) * IEN(0,IE) + LAMBDA(1) * IEN(1,IE) - K(1,IE) = LAMBDA(0) * IEN(2,IE) + LAMBDA(1) * IEN(3,IE) - K(2,IE) = LAMBDA(0) * IEN(4,IE) + LAMBDA(1) * IEN(5,IE) -;IF (ID EQ 0) THEN PRINT,'K CHANGE:',ID,ISHIFT,IE2,IE,K(*,IE) - ENDFOR - - FOR II=0,NN-1 DO BEGIN - IP = NODES(II) ; computes time step for fixed node ... - J=JCELLS(IP)-1 - KSUM = 0.0 - FOR I = 0, CCON(IP)-1 DO BEGIN - J = J + 1 - IE = IE_CELL(J) - POS = POS_CELL(J) - KSUM = KSUM + MAX([K(POS,IE),0.0]) -;IF (ID EQ 0) THEN PRINT,'K EFF CHANGE:',ID,ISHIFT,I,IE,K(POS,IE),KSUM - ENDFOR - DTMAX_EXP_LOCAL = SI(IP)/MAX([DOUBLE(10.E-10),KSUM]) - DTMAX_EXP(II) = MIN([DTMAX_EXP_LOCAL,DTMAX_EXP(II)]) - ENDFOR - ENDFOR - TSTEPS(*,ISHIFT)=DTMAX_EXP(*) - ENDFOR - ISHIFT = NSHIFT/2 - TMAX=TIMESTEPS_ALL(IP0) - FOR I=0,NSHIFT-1 DO BEGIN - IF TSTEPS(0,I) GT TMAX AND MIN(TSTEPS(1:NN-1,I)) > TSTEPS(0,I) THEN BEGIN - ISHIFT = I - TMAX = TSTEPS(0,I) - ENDIF - ENDFOR - ; PRINT,'OPTI DT:',IPS+1,IP0+1,NODES(0)+1,TIMESTEPS_ALL(IP0),TSTEPS(0,ISHIFT) - TIMESTEPS_ALL(NODES)=TSTEPS(*,ISHIFT) - gridmat(0,IPS)= XSHIFT(ISHIFT) - gridmat(1,IPS)= YSHIFT(ISHIFT) - XYtoLATLON,gridmat(0,IPS),gridmat(1,IPS),latdeg,latmin,londeg,lonmin - gridmat(2,IPS)=latdeg - gridmat(3,IPS)=latmin - gridmat(4,IPS)=londeg - gridmat(5,IPS)=lonmin - - OPLOT,[gridmat(0,IPS)],[gridmat(1,IPS)], $ - psym=5,SYMSIZE=3,COLOR=255 - - ORDER=SORT(TIMESTEPS_ALL ) -; PRINT,'Nodes giving smallest time steps:',ORDER(0:50)+1 -; PRINT,'Values of these time steps (s) :',TIMESTEPS_ALL(ORDER(0:50)) - TIMESTEPS=FLTARR(4,NTIMESTEPS) - FOR I=0,NTIMESTEPS-1 DO BEGIN - IND1=ORDER(I) - TIMESTEPS(0,I)=IND1 - TIMESTEPS(1,I)=TIMESTEPS_ALL(IND1) - TIMESTEPS(2,I)=gridmat(0,IND1) - TIMESTEPS(3,I)=gridmat(1,IND1) - ENDFOR - FLAGTSTEP=1 - TIMESTEPS_ORDER=ORDER - - RETURN -END - -;---------------------------------------------------------- -PRO UPDATE_TIMESTEPS2,IP0 -; Recomputes timesteps: uses x-y coordinates -; -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,TRIGP,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER -COMMON TIMESTEPSUG2, CCON, IEN, SI, AREA, WCG, CELLVERTEX, IE_CELL, POS_CELL, C, K -COMMON TIMESTEPSUG3, SIRATIO, JCELLS, LEN, ANGLE0, CROSSDIFF, TIMESTEPS_ALL -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -;*******END OF COMMON BLOCKS******************************* -; - indtri=WHERE(TRIGP EQ IP0+1,kount) - ALLNODES=LONARR(kount*3) - TRIANGLES=LONARR(kount) - FOR ITRI=0,kount-1 DO BEGIN - ARRAY_IND2,TRIGP, indtri(ITRI),ind1 - ; PRINT,'C_GP:',IP0+1,' IN', ind1(0),ind1(1),TRANSPOSE(TRIGP(ind1(0),*)) - ALLNODES(ITRI*3:ITRI*3+2) = TRANSPOSE(TRIGP(ind1(0),1:3))-1 - TRIANGLES(ITRI)=ind1(0)-1 - ENDFOR - NODES =ALLNODES(UNIQ(ALLNODES, SORT(ALLNODES))) - - ONETHIRD=1/3. - ONESIXTH=1/6. - THR=1.E-20 - NTRI2=kount - NNGP2=N_ELEMENTS(NODES) - SIGMA = 8.d0*ATAN(1.d0)/WAVEPERIOD - -; -; Finds all relevant triangles -; - ALLTRI=[0] - FOR IND=0,NNGP2-1 DO BEGIN - SI(NODES(IND))=0 - indtri=WHERE(TRIGP EQ NODES(IND)+1,kount) - FOR ITRI=0,kount-1 DO BEGIN - ARRAY_IND2,TRIGP, indtri(ITRI),ind1 - ALLTRI=[ALLTRI, ind1(0)-1] - ENDFOR - ENDFOR - UNITRI=ALLTRI(UNIQ(ALLTRI, SORT(ALLTRI))) -; -; Updates SI array -; - FOR IND=1,N_ELEMENTS(UNITRI)-1 DO BEGIN - IE = UNITRI(IND) - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - DXP1 = gridmat(0,I2) - gridmat(0,I1) - DYP1 = gridmat(1,I2) - gridmat(1,I1) - DXP2 = gridmat(0,I3) - gridmat(0,I2) - DYP2 = gridmat(1,I3) - gridmat(1,I2) - DXP3 = gridmat(0,I1) - gridmat(0,I3) - DYP3 = gridmat(1,I1) - gridmat(1,I3) - IEN(0,IE) = - DYP2 - IEN(1,IE) = DXP2 - IEN(2,IE) = - DYP3 - IEN(3,IE) = DXP3 - IEN(4,IE) = - DYP1 - IEN(5,IE) = DXP1 - AREA(IE) = (DXP3*DYP1 - DYP3*DXP1)*0.5 - INDNODE=WHERE(NODES EQ I1,knode) - IF (knode GT 0) THEN SI(NODES(INDNODE)) = SI(NODES(INDNODE)) + AREA(IE)*ONETHIRD - INDNODE=WHERE(NODES EQ I2,knode) - IF (knode GT 0) THEN SI(NODES(INDNODE)) = SI(NODES(INDNODE)) + AREA(IE)*ONETHIRD - INDNODE=WHERE(NODES EQ I3,knode) - IF (knode GT 0) THEN SI(NODES(INDNODE)) = SI(NODES(INDNODE)) + AREA(IE)*ONETHIRD - IF (AREA(IE) LT SIRATIO(I1)) THEN SIRATIO(I1) = AREA(IE) - IF (AREA(IE) LT SIRATIO(I2)) THEN SIRATIO(I2) = AREA(IE) - IF (AREA(IE) LT SIRATIO(I3)) THEN SIRATIO(I3) = AREA(IE) - ENDFOR - - - DEPTHS2= gridmat(7,NODES) + ZOFFSET ; Should probably update depths when moving nodes - - DISPERSION,SIGMA,DEPTHS2,WCG2 - WCG(NODES)=WCG2 - -; No update of connectivity - - DTMAX_EXP = TIMESTEPS_ALL - DTMAX_EXP(NODES) = 1./THR - - NTH=24 - THETA=FINDGEN(NTH)*2*!pi/NTH - COSTH=COS(THETA) - SINTH=SIN(THETA) - - LATTOM = 1000. ; !dtor * 6378137.0d0 - LAMBDA = FLTARR(2) -; -; Loops on directions -; -; GET_LUN,unit -; OPENW,unit,'fort_upd.996' - FOR ID = 0, NTH-1 DO BEGIN - -; -; Updates speed at nodes IP0 : maybe other change later when depth is updated ... -; FOR NOW WCG is not changed -; - COSFAC = 1. ; COS((FLOAT(gridmat(2,IP0))+gridmat(3,IP0)/60.)*!dtor ) - - FOR IP = 0, NNGP-1 DO BEGIN - COSFAC = 1. ;COS((FLOAT(gridmat(2,IP))+gridmat(3,IP)/60.)*!dtor) - C(0,IP) = WCG(IP)*COSTH(ID)/(LATTOM*COSFAC) - C(1,IP) = WCG(IP)*SINTH(ID)/LATTOM - ENDFOR - - FOR IND = 1,N_ELEMENTS(UNITRI)-1 DO BEGIN - IE = UNITRI(IND) - I1 = TRIGP(IE+1,1)-1 - I2 = TRIGP(IE+1,2)-1 - I3 = TRIGP(IE+1,3)-1 - LAMBDA(0) = ONESIXTH * (C(0,I1)+C(0,I2)+C(0,I3)) - LAMBDA(1) = ONESIXTH * (C(1,I1)+C(1,I2)+C(1,I3)) - K(0,IE) = LAMBDA(0) * IEN(0,IE) + LAMBDA(1) * IEN(1,IE) - K(1,IE) = LAMBDA(0) * IEN(2,IE) + LAMBDA(1) * IEN(3,IE) - K(2,IE) = LAMBDA(0) * IEN(4,IE) + LAMBDA(1) * IEN(5,IE) -;IF (I1 EQ 70 OR I2 EQ 70 OR I3 EQ 70) THEN PRINTF,unit,FORMAT='(5I8,6F9.5,7F16.8)', $ -; ID+1,I1+1,I2+1,I3+1,IE+1,IEN(0:5,IE),LAMBDA(*),K(*,IE),COSTH(ID),SINTH(ID) -;IF (I1 EQ 70 OR I2 EQ 70 OR I3 EQ 70) THEN PRINTF,unit,FORMAT='(8I6,8F16.8)', $ -; ID+1,I1+1,I2+1,I3+1,IE+1,I1,I2,I3,LAMBDA(*),K(*,IE),C(0,I1),C(0,I2),C(0,I3) - ENDFOR - - FOR IP2 = 0, NNGP2-1 DO BEGIN - IP = NODES(IP2) - J=JCELLS(IP)-1 - KSUM = 0.0 - FOR I = 0, CCON(IP)-1 DO BEGIN - J = J + 1 - IE = IE_CELL(J) - POS = POS_CELL(J) - KSUM = KSUM + MAX([K(POS,IE),0.0]) - I1 = TRIGP(IE+1,1) - I2 = TRIGP(IE+1,2) - I3 = TRIGP(IE+1,3) -; IF (IP EQ 70) THEN printf,unit,FORMAT='(9I6,6F14.9)',ID+1,IP+1,I+1,J+1,IE+1,POS+1,I1,I2,I3,K(POS,IE),KSUM - ;IF ( ABS(K(POS,IE)) > KMAX ) KMAX = ABS(K(POS,IE)) - ENDFOR - DTMAX_EXP_LOCAL = SI(IP)/MAX([DOUBLE(10.E-10),KSUM]) - ; IF (IP.EQ.392) WRITE(997,'(2I8,5F16.9)') ID,IP,SI(IP),WCG(IP),MYXYZ(3,IP),KSUM,DTMAX_EXP(IP) - - DTMAX_EXP(IP) = MIN([DTMAX_EXP_LOCAL,DTMAX_EXP(IP)]) -; IF (IP EQ 70) THEN printf,unit,FORMAT='(2I8,6F16.9)', ID+1,IP+1,SI(IP),WCG(IP),GRIDMAT(7,IP),KSUM,DTMAX_EXP_LOCAL,DTMAX_EXP(IP) - ENDFOR - ENDFOR -; close,unit -; free_lun,unit - PRINT,'Updated time steps for nodes :',NODES+1 - PRINT,'Old time steps (s) :',TIMESTEPS_ALL(NODES) - TIMESTEPS_ALL(NODES)=DTMAX_EXP(NODES) - ORDER=SORT(DTMAX_EXP) - PRINT,'New time steps (s) :',DTMAX_EXP(NODES) - TIMESTEPS=FLTARR(4,NTIMESTEPS) - FOR I=0,NTIMESTEPS-1 DO BEGIN - IND1=ORDER(I) - TIMESTEPS(0,I)=IND1 - TIMESTEPS(1,I)=DTMAX_EXP(IND1) - TIMESTEPS(2,I)=gridmat(0,IND1) - TIMESTEPS(3,I)=gridmat(1,IND1) - ;; PRINT,IND1+1, DTMAX_EXP(IND1), gridmat(4,IND1)+gridmat(5,IND1)/60.,gridmat(2,IND1)+gridmat(3,IND1)/60.,DEPTHS(IND1) - ENDFOR - FLAGTSTEP=1 - TIMESTEPS_ORDER=ORDER - RETURN -END - -;---------------------------------------------------------------------------- -PRO ARRAY_IND2, ARRAY, indices, IND2 - ni = N_ELEMENTS(indices) - - IND2 = LONARR(2, ni, /NOZERO) - TAILLE = SIZE(ARRAY, /DIMENSIONS) - IND2(0, *) = indices(*) mod TAILLE[0] - IND2(1, *) = indices(*)/TAILLE[0] - -END - -;---------------------------------------------------------------------------- -PRO MAKE_CONTOUR -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline - conti=FLTARR(nngp) - conti(*)=gridmat(6,*) - IND=WHERE(conti NE 0,kount) - IF (kount EQ 0) THEN BEGIN - contourline=LONARR(2,2) - ENDIF ELSE BEGIN - contourline=LONARR(kount+2,2)-1 - contourline(0,0)=IND(0) - contourline(1,0)=IND(kount-1)+2 - contourline(2:2+kount-1,0)=IND - contourline(2:2+kount-1,1)=conti(IND) - ENDELSE - RETURN -END diff --git a/model/aux/idl_twist/initmain.pro b/model/aux/idl_twist/initmain.pro deleted file mode 100755 index a73681e70..000000000 --- a/model/aux/idl_twist/initmain.pro +++ /dev/null @@ -1,501 +0,0 @@ -;/ -;/ +-----------------------------------+ -;/ | TWIST Ifremer-SHOM | -;/ | F. Ardhuin | -;/ | IDL command language | -;/ | Last update : 27-Oct-2013 | -;/ +-----------------------------------+ -;/ -;/ Licence information: This code is distributed under the CeCILL license -;/ generally compatible with the Gnu Public Licence (GPL) -;/ http://www.cecill.info/index.en.html -;/ -;/ 17-Oct-2013 : Clean up ( version 2.00 ) -;/ 27-Oct-2013 : Debugged interface version ( version 2.00 ) -;---------------------------------------------------------------------------- -; This subroutine defines user-dependent settings (default paths ...) -;---------------------------------------------------------------------------- -Pro Initmain -;+ -; NAME: -; Initmain -; PURPOSE: -; Initializes variables and flags (display, data ...) -; CALLING SEQUENCE: -; initmain -; INPUTS:none -; COMMON BLOCKS: -; CONTOURPARAM,CURRENT,DRAWING,DRAWSIZE,FLAGS,FONTS,TITLES,POSTSCRIPT -; THREED,ZOOM -; FREQ,DIR,TIME,SPACE, -; FILES,GRID,GRIDpar,RAY3,RAY3flags,RAYS -; MODIFICATION HISTORY: -; under construction (1/1/1999 - 6/1/2001) -;- - -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON LANGUAGE, ilang,dictionnaire -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON INTERFACE, TWISTVA_VERSION - - -;** 2 ** Display and data variables/parameters -common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - -COMMON FREQ, freq,nfband,findex,findex2 -COMMON DIR, nabin,nabint,aindex,THETA -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize - -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri -COMMON OVERLAY2,adbathydot,adcontour -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER - -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON DIR_STACK, DEPTH, STACK -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -COMMON Builder,ngp,H0,H1,Hi,KH0,KH1,DX0,DX1,T0,ROA,ROI,gridbuild_click -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON GRIDTIMESTEPS, zoffset, updateonmove, waveperiod -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth - -;*******END OF COMMON BLOCKS******************************* - -;***** Screen drawing dimensions ***************** - IF !D.NAME EQ 'WIN' THEN BEGIN ;adjusts the size of the draw window to PC/UNIX -; For MS Windows - xsize=800 ;x pixel size of drawing window - ysize=800 ;y pixel size of drawing window - ENDIF ELSE BEGIN -; For UNIX - xsize=600 ;x pixel size of drawing window - ysize=700 ;y pixel size of drawing window - ENDELSE - Wsimple=0 ;complexity of graphics interface - mwinx=xsize ;maximum length of draw window - mwiny=ysize ;maximum height of draw window - winx=xsize ;width of plot window - winy=ysize ;height of plot window - cbar=1 ;color bar flag: 1 adds color bar/ 0 no color bar (for 2D-3D color plots) - axis_orient=0 - bly = 0.1+float(cbar)/10. ; normalized bottom left y coordinate for draw region - blx = 0.15 ; normalized bottom left y coordinate for draw region - trx = 0.95 ; normalized top right x coordinate for draw region - ; not equal to one in order to leave space for the numbers on the - ;axes - try = 0.95 ; normalized top right y coordinate for draw region - textx=0.2 - texty=0.1 - textdx=0.16 - textdy=0.03 - - c_x=!values.F_NAN - cbblx=1. ;position of the color bar in the bottom margin (see procedure colorbar) - cbtrx=1. - cbbly=0.45 - cbtry=0.6 - - cbnticks=5 - cbexrange=1 - - ; Mapping parameters - - MAPFLAG=0 - MAPPROJ=0 - MAPLONGCENTER=-150 - MAPLATCENTER=0 - MAPLONLAT=1 - MAPCONTINENT=2 - MAPCOUNTRIES=0 - c_lon=1/0. - c_lat=1/0. - -; FILE TYPES: -; 2: 'Bathy log file' log file for the bathymetry -; 3: 'Binary bathy' binary bathymetry file -; 4: 'GSHHS coastline' binary shoreline file -; 5: ' ', -; 6: '*.line coastline' ASCII polyline -; 7: 'GMESH triangle-based grid', $ GMESH grid (as used in WAVEWATCH III) -; 8: 'Transect', $ -; 9: ' ', $ -;10: 'Observed time series', $ -;11: 'Modelled time series', $ -;12: 'Additional modelled TS', $ -;13: ' ', $ -;14: 'All modelled TS for new point', $ -;15: ' ', $ -;16: 'Additional bulk time series', $ -;17: 'WW3 NetCDF map', $ -;18: 'GSHHS coast', $ -;19: 'Data flags', $ -;20: 'WW3 map', $ -;21: 'WW3 map diff', $ -;22: 'Color palette' -; DEFAULT ACCESS PATHS FOR THESE FILES: - -; Paths under windows - - IF !VERSION.OS_FAMILY EQ 'Windows' THEN BEGIN - set_plot,'WIN' - device, decomposed=0 - raypath='D:\fabrice\IDL\' - paths=['D:\Fabrice\Runs\','C:\Fabrice\bathy\', $ - 'D:\DATA\bathy\','D:\DATA\bathy\', $ - 'D:\Fabrice\bathy\GLOBAL_COAST\','C:\fabrice\runs\', $ - 'C:\Fabrice\runs\', $ - 'C:\Fabrice\runs\','C:\Fabrice\runs\', $ - 'C:\Fabrice\DATA\', $ - 'C:\Fabrice\runs\', $ - 'C:\Fabrice\runs\', $ - 'C:\Fabrice\DATA\', $ - 'C:\Fabrice\DATA\SHOWEX\', $ - 'C:\Fabrice\DATA\DUCK94\8MARR94\', $ - 'C:\Fabrice\runs\','C:\Fabrice\SHOWEX\ANALYSIS\', $ - 'I:\runs\','D:\DATA\Bathy\GLOBAL_COAST\', $ - 'C:\Fabrice\DATA\','C:\Fabrice\DATA\','C:\Fabrice\DATA\',''] - pspath='C:\Fabrice\PAPERS\' - ENDIF ELSE BEGIN -; -; For UNIX -; - set_plot,'X' ,/COPY - device, pseudo_color=8 - device, decomposed=0, RETAIN=2 - raypath='.' - paths=['/export/home/ardhuin/RUNS/','/export/home/ardhuin/TOOLS/POLYMESH/TESTCASES/', $ - '/export/home/ardhuin/DATA/BATHY/','/export/home/ardhuin/DATA/BATHY/', $ - '/export/home/ardhuin/DATA/BATHY/GLOBAL_COAST/', '/export/home/ardhuin/', $ - '/export/home/ardhuin/DATA/BATHY/GLOBAL_COAST/','/export/home/ardhuin/', $ - '/export/home/ardhuin/','/export/home/ardhuin/', $ - '/export/home/ardhuin/', '/export/home/ardhuin/', $ - '/export/home/ardhuin/DATA/', '/export/home/ardhuin/DATA/', $ - '/export/home/ardhuin/', $ - '/data/span11/ardhuin/PAPERSC/','/export/home/ardhuin/TEMP/', $ - '/export/home/ardhuin/TEMP/','/export/home/ardhuin/DATA/BATHY/GLOBAL_COAST/', $ - '/export/home/ardhuin/DATA/','/export/home/ardhuin/RUNSAB/TESTWW3/', $ - '/export/home/ardhuin/RUNSAB/TESTWW3/','/export/home/ardhuin/TOOLS/IDL/palettes'] - pspath='~' - ENDELSE - !P.FONT=0 - LOADCT, 13 - - -; DEFAULT FILTERS FOR THESE FILES: - - filters=[ '*.inp','xyz.dat','*.log','*.grd','gshhs*.b' , $ - '*.line','*.*msh','*.grgp','*.tr', '*.*' , $ - '*.*','*.*','*.*','*.*','*.*' , $ - '8MARR*','*bulk*','*.nc','gshhs*.b','*.dat', $ - '*.*','*.*','*.ct'] - -; DEFAULT NAMES FOR THESE FILES: - filenames=['crest.inp','','duck1.log','w_duck1.grd','duck.coast', $ - 'duck30.grgp','depthstat.dat','trinet8zone.tri','','', $ - '','','','','','','','','','flags.dat', '', '',''] - -;This defines the user symbol, used when PSYM=8 -A = FINDGEN(17) * (!PI*2/16.) ;Make a vector of 16 points, A[i] = 2pi/16. -USERSYM, COS(A), SIN(A), /FILL ;Define the symbol to be a filled circle - -;General display variables - - outtit=1 ;1: diplays title / 0: hides title - outxtit=1 ;1: diplays xtitle / 0: hides xtitle - outytit=1 ;1: diplays ytitle / 0: hides ytitle - outcbtit=1 ;1: diplays color bar title / 0: hides title - - frametype=2 - outx1lab=1 - outx2lab=1 - outy1lab=1 - outy2lab=1 - - plottype=0 - plotncvar=0 - normvec=1 - filltype=0 ;current scheme for 2d plots (contour,bitmap..) - maxval=1.E6 ;maximum value for contouring - IF !D.NAME EQ 'WIN' THEN $ - Navailcolor=256 ELSE $ - Navailcolor=!D.N_colors;-1 ;number of colors in color table - IF Navailcolor GT 256 THEN BEGIN - Navailcolor=256 - ENDIF - - numlevels=11 ;default number of levels for contours - c_repart=0 ;current repartition of the contour levels (linear,log ...) - fixrange=0 ;0:the range of contours is fitted to data, 1:fixed to current values - filloutofrange=1 ; - - subwin=[0,0,0,0,0,0,0] ;status of subwindows (0:closed, 1: open): - ; [mesh editor,raytracer,parameters,palette,transects,specials] - - Ax3D=35. ;rotation angle around x-axis for 3D views - Az3D=45. ;rotation angle around z-axis for 3D views - smoothing=1 ;size of the square boxcar filter applied to 3D-displayed matrix - nbins=51 ;number of bins for QQ and binned plots - - -;Display options for overlays - addir=0 ;adds wave direction to plot if = 1 - adsyms=0 ;adds symbols for the grid points if = 1 - adbathy=0 ;overlays bathymetry contours if = 1 - adcoast=1 ;adds coast to 2D plots if =1 - adtri=0 - adbathydot=0 - adcontour=0 - - psyms=[8] ;symbol for grid points (5: triangles, 8: user defined) - psymsizes=[0.25] ;size of these symbols - - nstep=1 ;number of raytimesteps in the ABCDEFGHI an 8MARR files - dtime=180 ;raytimestep between two files in minutes - - c_gp=1 ;current grid point (used for "local" plots: f spectrum...) - c_spec=0 - c_cut=0 ;current "cut": 2D plane, local ... - datatype=0 -FLAGTSTEP=0 - - - ;***** postscript settings, units are cm ***************** - papierx=21.5;21.0 ; x-size of the paper - papiery=27.8 ;29.7 ; y-size of the paper - pwinx=19.5 ;19.0 ; width of paper in cm (printable area) - pwiny=25.8 ;27.7 ; height of draw paper in cm (printable area) - facpolice= 1. ; scaling factor for text on postscript - fontrescale=1 - basefontsize=10 - psfont=0 - xoffset=1.0 ; offset from the paper edge - yoffset=2.0 ; offset from the paper edge - psor=0 ; print orientation eq 0 for portrait, 1 for landscape - eqscale=1 ; 1 if x and y scales are equal - output=0 ; 0: screen / 1: postscript file - pstype=0 ; type of postcript file, 0: normal / 1: encapsulated - prcoul=1 ; black and white (0) / color (1) - - -; variables for Bathy grid and coastline - rlonmin=0.D ;minimum longitude (negative if W) - rlonmax=0.D ;maximum longitude (neg. if W) - rlatmin=0.D ;min. latitude (neg. if S) - rlatmax=0.D ;max. latitude - sx=0.D ;grid resolution in meters in the x direction (W-E) - sy=0.D ;grid resolution in meters in the y direction (S-N) - nx=0 ;number of grid points (bathymetry) in x - ny=0 ;number of grid points (bathymetry) in y - - - - -; defines default parameters for grid - zoffset=4 ; - WAVEPERIOD = 26.809651 - updateonmove=1 ; - nzone=5 - c_zone=5 - zcolor=INTARR(nzone+1)-1 - - - - nfband=2 ;number of frequencies - nabin=2 ;number of directions - timezone_plot=-0 ;-5;time zone of the plot output - timezone_string='UTC' ;'EST' ;corresponding abbreviation - ntime=2 ;number of raytimesteps for which data is available, - ;maximum range of the time "widget slider" - ndtime=2 ;ndtime: maximum range of the "dt" slider, i.e. - ; maximum value of the dtindex variables - ; which prescribes the number of raytimesteps to be skipped - ; when moving the time slider - findex=1 ;current frequency (prescribed by action on a slider) - findex2=1 ;current frequency (prescribed by action on a slider) - aindex=0 ;current direction (prescribed by action on a slider) - tindex=1 ;current timestep (slider) - dtindex=1 ;cf. ndtime - tindex2=1 - - -;Variables and flags for the computation and display of rays - RaysOk=0 ;1 if rays have be computed (call to fortran) and are - ;ready for display - raytimestep=5. ;timestep between two points on a ray - rayfreq=0.05 ;frequency of the rays - rayres=1. ;difference in initial directions between 2 rays (deg) - rayGP=1. ;combined index of the grid points from which rays are - ;computed - rayamin=-90. ;angle (relative to x axis) of the first ray - rayamax=90. ;angle (idem) of the last ray - rayoffdep=300. ;depth at which the ray are stopped - raydz=0. ;mean water level adjustment for the ray computation - raymindepth=8. - -;Variables and flags for the computation and display of transects - adtr=1 - TransOK=0 - transthick=1 - transline=0 - transsym=1 - - nxzmax=0 ;x index of the top right point for the zoom - nyzmax=0 ;y index of the top right point for the zoom - nxzmin=0 ;x index of the bottom left point for the zoom - nyzmin=0 ;y index of the bottom left point for the zoom - maxdepth=100. ;top of range for 2D plot (bathy, RAY3 ...) - mindepth=0. ;min of range for 2D plot (bathy, RAY3 ...) - logplot=0 - - ts_filetype=0 - - clickflag=0 ;flags that specifies the action triggered by the - ;next click. - ;0: uptates c_gp with the index of the grid point - ; closest to the cursor - - nfiletypes=23 - - filestatus=BYTARR(nfiletypes) ;resets all sorts of data files to "closed" - datastatus=BYTARR(nfiletypes) ;resets all sorts of data to "not available" - - ilang=0 - dictionnaire={days:['Days','Jours'],at:['at','a'], $ - hs:['Significant wave height','Hauteur significative des vagues'], $ - Wdir:['W','O'], dpt:['depth','profondeur']} - months=STRARR(2,12) - months(0,*)=['January', 'February', 'March', 'April', 'May', 'June', 'July', $ - 'August', 'September', 'October', 'November', 'December'] - months(1,*)=['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', $ - 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Decembre'] - -; -; Variables for mesh editor -; - ROA=0 - H0=8. - H1=1500. - Hi=60. - DX0=1. - DX1=15. - T0=10. - Hlandsea=-9.; - - -TWISTVA_VERSION='RUNTIME'; - - GET_LUN,unit - OPENR,unit,'TWIST_init.txt', ERROR=openerr - IF (OPENERR EQ 0) THEN BEGIN - PRINT,'Reading user defined parameters from TWIST_init.txt' - RSTRING=' ' - RINT=0 - RINT2=0 - RFLOAT=0. - - RFLOAT2=0. - NCOM=0 - WHILE (NOT EOF(unit)) DO BEGIN - CASE NCOM OF - 0: BEGIN - PRINT,'Reading plot window size' - READF,unit,RINT1,RINT2 - mwinx=RINT1 ;maximum length of draw window - mwiny=RINT2 ;maximum height of draw window - winx=RINT1 ;width of plot window - winy=RINT2 ;height of plot window - END - 1:BEGIN - PRINT,'Reading paths for the ',nfiletypes,' file types.' - FOR I=0,nfiletypes-1 DO BEGIN - READF,unit,RSTRING,FORMAT='(A)' - IPOS=STRPOS(RSTRING,' ') - IF (IPOS GT 0) THEN RSTRING=STRMID(RSTRING,0,IPOS-1) - paths(I)=RSTRING - ENDFOR - END - 2:BEGIN - PRINT,'Reading longitude and latitude for time series export ... ' - READF,unit,RFLOAT,RFLOAT2 - c_lon=RFLOAT - c_lat=RFLOAT2 - print,'Target longitude and latitude:',c_lon,c_lat - END - 3: BEGIN - PRINT,'Reading interface complexity flag: (0 = full interface, 1 = simplified interface)' - READF,unit,RINT1 - Wsimple=RINT1 - END - 4: BEGIN - file2=''; - READF,unit,RSTRING,FORMAT='(A)' - IPOS=STRPOS(RSTRING,' ') - IF (IPOS GT 0) THEN RSTRING=STRMID(RSTRING,0,IPOS) - file2=RSTRING - message,'Loading table ' + file2,/INFO - GET_LUN,lun2 - OPENR,lun2,file2 - r=BYTARR(256) - g=BYTARR(256) - b=BYTARR(256) - READF,lun2,r,g,b - cbot = 0 - nc = !d.table_size - cbot - if nc ne 256 then begin ;Interpolate - p = (lindgen(nc) * 255) / (nc-1) - r = r[p] - g = g[p] - b = b[p] - endif - r_orig[cbot] = r - g_orig[cbot] = g - b_orig[cbot] = b - r_curr = r_orig - g_curr = g_orig - b_curr = b_orig - tvlct,r, g, b, cbot - CLOSE,lun2 - END - 5: BEGIN - TWISTVA_VERSION='LICENCE'; - READF,unit,RSTRING,FORMAT='(A)' - IPOS=STRPOS(RSTRING,'R') - IF (IPOS GE 0) THEN TWISTVA_VERSION='RUNTIME' - PRINT,RSTRING,'Choice of inteface version (LICENCE/RUNTIME):',TWISTVA_VERSION - END - ELSE: - ENDCASE - NCOM=NCOM+1 - ENDWHILE - CLOSE,UNIT - FREE_LUN,UNIT - ENDIF - -END diff --git a/model/aux/idl_twist/julday.pro b/model/aux/idl_twist/julday.pro deleted file mode 100644 index 56e121673..000000000 --- a/model/aux/idl_twist/julday.pro +++ /dev/null @@ -1,189 +0,0 @@ -; $Id: //depot/idl/releases/IDL_80/idldir/lib/julday.pro#1 $ -; -; Copyright (c) 1988-2010, ITT Visual Information Solutions. All -; rights reserved. Unauthorized reproduction is prohibited. - -;+ -; NAME: -; JULDAY -; -; PURPOSE: -; Calculate the Julian Day Number for a given month, day, and year. -; This is the inverse of the library function CALDAT. -; See also caldat, the inverse of this function. -; -; CATEGORY: -; Misc. -; -; CALLING SEQUENCE: -; Result = JULDAY([[[[Month, Day, Year], Hour], Minute], Second]) -; -; INPUTS: -; MONTH: Number of the desired month (1 = January, ..., 12 = December). -; -; DAY: Number of day of the month. -; -; YEAR: Number of the desired year.Year parameters must be valid -; values from the civil calendar. Years B.C.E. are represented -; as negative integers. Years in the common era are represented -; as positive integers. In particular, note that there is no -; year 0 in the civil calendar. 1 B.C.E. (-1) is followed by -; 1 C.E. (1). -; -; HOUR: Number of the hour of the day. -; -; MINUTE: Number of the minute of the hour. -; -; SECOND: Number of the second of the minute. -; -; Note: Month, Day, Year, Hour, Minute, and Second can all be arrays. -; The Result will have the same dimensions as the smallest array, or -; will be a scalar if all arguments are scalars. -; -; OPTIONAL INPUT PARAMETERS: -; Hour, Minute, Second = optional time of day. -; -; OUTPUTS: -; JULDAY returns the Julian Day Number (which begins at noon) of the -; specified calendar date. If Hour, Minute, and Second are not specified, -; then the result will be a long integer, otherwise the result is a -; double precision floating point number. -; -; COMMON BLOCKS: -; None. -; -; SIDE EFFECTS: -; None. -; -; RESTRICTIONS: -; Accuracy using IEEE double precision numbers is approximately -; 1/10000th of a second, with higher accuracy for smaller (earlier) -; Julian dates. -; -; MODIFICATION HISTORY: -; Translated from "Numerical Recipies in C", by William H. Press, -; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. -; Cambridge University Press, 1988 (second printing). -; -; AB, September, 1988 -; DMS, April, 1995, Added time of day. -; CT, April 2000, Now accepts vectors or scalars. -;- -; -function JULDAY, MONTH, DAY, YEAR, Hour, Minute, Second - -COMPILE_OPT idl2 - -ON_ERROR, 2 ; Return to caller if errors - -; Gregorian Calander was adopted on Oct. 15, 1582 -; skipping from Oct. 4, 1582 to Oct. 15, 1582 -GREG = 2299171L ; incorrect Julian day for Oct. 25, 1582 - -; Process the input, if all are missing, use todays date. -NP = n_params() -IF (np EQ 0) THEN RETURN, SYSTIME(/JULIAN) -IF (np LT 3) THEN MESSAGE, 'Incorrect number of arguments.' - -; Find the dimensions of the Result: -; 1. Find all of the input arguments that are arrays (ignore scalars) -; 2. Out of the arrays, find the smallest number of elements -; 3. Find the dimensions of the smallest array - -; Step 1: find all array arguments -nDims = [SIZE(month,/N_DIMENSIONS), SIZE(day,/N_DIMENSIONS), $ - SIZE(year,/N_DIMENSIONS), SIZE(hour,/N_DIMENSIONS), $ - SIZE(minute,/N_DIMENSIONS), SIZE(second,/N_DIMENSIONS)] -arrays = WHERE(nDims GE 1) - -nJulian = 1L ; assume everything is a scalar -IF (arrays[0] GE 0) THEN BEGIN - ; Step 2: find the smallest number of elements - nElement = [N_ELEMENTS(month), N_ELEMENTS(day), $ - N_ELEMENTS(year), N_ELEMENTS(hour), $ - N_ELEMENTS(minute), N_ELEMENTS(second)] - nJulian = MIN(nElement[arrays], whichVar) - ; step 3: find dimensions of the smallest array - CASE arrays[whichVar] OF - 0: julianDims = SIZE(month,/DIMENSIONS) - 1: julianDims = SIZE(day,/DIMENSIONS) - 2: julianDims = SIZE(year,/DIMENSIONS) - 3: julianDims = SIZE(hour,/DIMENSIONS) - 4: julianDims = SIZE(minute,/DIMENSIONS) - 5: julianDims = SIZE(second,/DIMENSIONS) - ENDCASE -ENDIF - -d_Second = 0d ; defaults -d_Minute = 0d -d_Hour = 0d -; convert all Arguments to appropriate array size & type -SWITCH np OF ; use switch so we fall thru all arguments... -6: d_Second = (SIZE(second,/N_DIMENSIONS) GT 0) ? $ - second[0:nJulian-1] : second -5: d_Minute = (SIZE(minute,/N_DIMENSIONS) GT 0) ? $ - minute[0:nJulian-1] : minute -4: d_Hour = (SIZE(hour,/N_DIMENSIONS) GT 0) ? $ - hour[0:nJulian-1] : hour -3: BEGIN ; convert m,d,y to type LONG - L_MONTH = (SIZE(month,/N_DIMENSIONS) GT 0) ? $ - LONG(month[0:nJulian-1]) : LONG(month) - L_DAY = (SIZE(day,/N_DIMENSIONS) GT 0) ? $ - LONG(day[0:nJulian-1]) : LONG(day) - L_YEAR = (SIZE(year,/N_DIMENSIONS) GT 0) ? $ - LONG(year[0:nJulian-1]) : LONG(year) - END -ENDSWITCH - - -min_calendar = -4716 -max_calendar = 5000000 -minn = MIN(l_year, MAX=maxx) -IF (minn LT min_calendar) OR (maxx GT max_calendar) THEN MESSAGE, $ - 'Value of Julian date is out of allowed range.' -if (MAX(L_YEAR eq 0) NE 0) then message, $ - 'There is no year zero in the civil calendar.' - - -bc = (L_YEAR LT 0) -L_YEAR = TEMPORARY(L_YEAR) + TEMPORARY(bc) -inJanFeb = (L_MONTH LE 2) -JY = L_YEAR - inJanFeb -JM = L_MONTH + (1b + 12b*TEMPORARY(inJanFeb)) - - -JUL = floor(365.25d * JY) + floor(30.6001d*TEMPORARY(JM)) + L_DAY + 1720995L - - -; Test whether to change to Gregorian Calandar. -IF (MIN(JUL) GE GREG) THEN BEGIN ; change all dates - JA = long(0.01d * TEMPORARY(JY)) - JUL = TEMPORARY(JUL) + 2L - JA + long(0.25d * JA) -ENDIF ELSE BEGIN - gregChange = WHERE(JUL ge GREG, ngreg) - IF (ngreg GT 0) THEN BEGIN - JA = long(0.01d * JY[gregChange]) - JUL[gregChange] = JUL[gregChange] + 2L - JA + long(0.25d * JA) - ENDIF -ENDELSE - - -; hour,minute,second? -IF (np GT 3) THEN BEGIN ; yes, compute the fractional Julian date -; Add a small offset so we get the hours, minutes, & seconds back correctly -; if we convert the Julian dates back. This offset is proportional to the -; Julian date, so small dates (a long, long time ago) will be "more" accurate. - eps = (MACHAR(/DOUBLE)).eps - eps = eps*ABS(jul) > eps -; For Hours, divide by 24, then subtract 0.5, in case we have unsigned ints. - jul = TEMPORARY(JUL) + ( (TEMPORARY(d_Hour)/24d - 0.5d) + $ - TEMPORARY(d_Minute)/1440d + TEMPORARY(d_Second)/86400d + eps ) -ENDIF - -; check to see if we need to reform vector to array of correct dimensions -IF (N_ELEMENTS(julianDims) GT 1) THEN $ - JUL = REFORM(TEMPORARY(JUL), julianDims) - -RETURN, jul - -END diff --git a/model/aux/idl_twist/make_visu_package.pro b/model/aux/idl_twist/make_visu_package.pro deleted file mode 100755 index 8278358ab..000000000 --- a/model/aux/idl_twist/make_visu_package.pro +++ /dev/null @@ -1,14 +0,0 @@ -.FULL_RESET_SESSION -.compile initmain.pro -.compile rt_visumain.pro -.compile read_timeseries.pro -.compile mapping.pro -.compile gridbuild.pro -.compile bathytool.pro -.compile editspecials.pro -.compile maketransect.pro -.compile raytracer.pro -.compile parametros.pro -.compile julday.pro -RESOLVE_ALL -SAVE,/ROUTINES,FILENAME='rt_visumain.sav' diff --git a/model/aux/idl_twist/make_visu_tar.sh b/model/aux/idl_twist/make_visu_tar.sh deleted file mode 100755 index 28f7cdfa6..000000000 --- a/model/aux/idl_twist/make_visu_tar.sh +++ /dev/null @@ -1,6 +0,0 @@ -tar -cvf rt_visumain.tar visu.pro initmain.pro rt_visumain.pro read_timeseries.pro julday.pro mapping.pro gridbuild.pro bathytool.pro editspecials.pro maketransect.pro raytracer.pro parametros.pro palette.pro xloadpalette.pro -tar -uvf rt_visumain.tar palettes/* -tar -uvf rt_visumain.tar rayp.f90 raypfc.f90 raypf.f90 raypg.f90 -tar -uvf rt_visumain.tar TWIST_init.txt -gzip rt_visumain.tar - diff --git a/model/aux/idl_twist/maketransect.pro b/model/aux/idl_twist/maketransect.pro deleted file mode 100755 index 79f32ada3..000000000 --- a/model/aux/idl_twist/maketransect.pro +++ /dev/null @@ -1,460 +0,0 @@ -;---------------------------------------------------------------------------- -PRO Maketransect, anterior_root -;---------------------------------------------------------------------------- -; This procedure generates the widgets for the "transect designer" subwindow -; These widgets allow to interactively modify the position of the points -; used as a basis for the transect, as well as the method to get other points -; between these basis points. -; The interpolation coefficients for the triangle network are generated for -; each point of the transect by calling a fortran code, similar to Ray3a. -;---------------------------------------------------------------------------- -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON WTwidgets,WTline1,WTline2,WTline4,WTgrideditor -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON TRANSLOC,igpt,thetatrans,gridtmat,transtype -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat - - thetatrans=0 - ntrans=30 - transsym=1 - transsymsize=0.5 - transthick=1 - transline=0 - IF transOK EQ 0 THEN BEGIN - ntransgp=10 - GRIDTMAT=FLTARR(7,ntransgp) - spectransname=STRARR(ntransgp) - ENDIF - igpt=0 - pbase=LONG(0) - vecbase=LONG(0) - Line1=LONG(0) - WTline1=LONARR(5) - - - pbase = WIDGET_BASE(TITLE='Transect designer', /COLUMN) - WIDGET_CONTROL, pbase, GROUP_LEADER=root - - Line1=WIDGET_BASE(pbase, /FRAME, /ROW) - WTline1(0)=WIDGET_LABEL(Line1, $ - VALUE='Basis points: ') - WTline1(1)=WIDGET_TEXT(Line1,/EDITABLE, XSIZE=5, YSIZE=1, $ - VALUE=STRCOMPRESS(String(ntransgp))) - WTline1(2)=WIDGET_LABEL(Line1,VALUE='Points in transect: ') - WTline1(3)=WIDGET_TEXT(Line1,/EDITABLE, XSIZE=5, YSIZE=1, $ - VALUE=STRCOMPRESS(String(ntrans))) - WTline1(4)=WIDGET_DROPLIST(Line1, $ - VALUE=['Lines','Splines']) - - Line2=WIDGET_BASE(pbase, /FRAME, /ROW) - WTgrideditor=LONARR(3) - WTgrideditor(1)= $ - WIDGET_TABLE(line2, /EDITABLE, $ - COLUMN_LABELS=['I','X','Y','Lat','min','Lon','min'], $ - YSIZE=ntransgp+1,XSIZE=9, /RESIZEABLE_COLUMNS, $ - COLUMN_WIDTHS=[40,80,80,60,100,60,100], $ - /SCROLL,Y_SCROLL_SIZE=10,X_SCROLL_SIZE=7, $ - UNITS=0) - - Line3=WIDGET_BASE(pbase, /FRAME, /ROW) - WTline2=LONARR(14) - WTline2(0)=WIDGET_LABEL(Line3,VALUE='Current point and name: ') - WTline2(1)=WIDGET_SLIDER(Line3, MAXIMUM=ntransgp, MINIMUM=1) - WTline2(2)=WIDGET_TEXT(Line3,/EDITABLE, value=spectransname(0)) - Line4=WIDGET_BASE(pbase, /FRAME, /ROW) - WTline2(3)=WIDGET_BUTTON(Line4, VALUE='Take c_gp') - WTline2(4)=WIDGET_LABEL(Line4, value='Take special #:') - WTline2(5)=WIDGET_TEXT(Line4,/EDITABLE,XSIZE=3,value='1') - Line5=WIDGET_BASE(pbase, /FRAME, /ROW) - WTline2(6)=WIDGET_LABEL(Line5, value='Sym:') - WTline2(7)=WIDGET_TEXT(Line5, XSIZE=5, $ - value=STRCOMPRESS(STRING(transsym))) - WTline2(8)=WIDGET_LABEL(Line5, value='Size:') - WTline2(9)=WIDGET_TEXT(Line5, XSIZE=5, $ - value=STRCOMPRESS(STRING(transsymsize))) - WTline2(10)=WIDGET_LABEL(Line5, value='Line:') - WTline2(11)=WIDGET_TEXT(Line5, XSIZE=5, $ - value=STRCOMPRESS(STRING(transline))) - WTline2(12)=WIDGET_LABEL(Line5, value='Thick:') - WTline2(13)=WIDGET_TEXT(Line5, XSIZE=5, $ - value=STRCOMPRESS(STRING(transthick))) - - - XMENU, ['Move points','End move','Delete points'],pbase, /ROW,$ - UVALUE=[0,1,2], BUTTONS = menu_ids, /FRAME - XMENU, ['Generate Transect','Compute inter','Save transect','Load transect'],pbase, /ROW,$ - UVALUE=[0,1,2,3], BUTTONS = menu_ids, /FRAME - - - Line4=WIDGET_BASE(pbase, /FRAME, /ROW) - WTline4=LONARR(3) - WTline4(0)= WIDGET_TEXT(Line4,YSIZE=1,VALUE='Use ray with direction:') - WTline4(1) = WIDGET_TEXT(Line4,/EDITABLE, $ - value=strcompress(string(thetatrans))) - - - Line5 = WIDGET_BUTTON(pbase, VALUE='OK') - WIDGET_CONTROL, /REALIZE, pbase - DisplayTgrid - subwin(0)=1 - XMANAGER, 'MakeTransect', pbase -RETURN -END - - -;---------------------------------------------------------------------------- -PRO MakeTransect_event, ev -;---------------------------------------------------------------------------- -; Deals with the actions on the widgets of the transect subwindow -;---------------------------------------------------------------------------- -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON WTwidgets,WTline1,WTline2,WTline4,WTgrideditor -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON TRANSLOC,igpt,thetatrans,gridtmat,transtype -COMMON SPACE, c_gp,c_cut,indexgp -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused -COMMON FILES, filestatus,datastatus,paths,filters,filenames -COMMON SPECIALS,nspecgp,specmat,specname - - typo = TAG_NAMES(ev, /STRUCTURE) - CASE typo OF - 'WIDGET_BUTTON': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'OK': BEGIN - WIDGET_CONTROL, /DESTROY, ev.top - subwin(4)=0 - RETURN - END - 'Move points':clickflag=4 - 'End move':clickflag=0 - 'Take c_gp':BEGIN - print,'c_gp...:',c_gp,igpt - gridtmat(0,igpt)=c_gp - gridtmat(1:6,igpt)=gridmat(0:5,c_gp-1) - UpdateTtable,0,igpt - END - 'Compute inter':BEGIN - Ztrans=FLTARR(Ntrans) - Itrans=INTARR(Ntrans,3) - COtrans=FLTARR(Ntrans,3) - IF (datastatus(7) NE 0) THEN BEGIN - GET_LUN,unit - OPENW,unit,'transect.inp' - PRINTF,unit,paths(2)+filenames(2) - PRINTF,unit,paths(3)+filenames(3) - PRINTF,unit,paths(5)+filenames(5) - PRINTF,unit,paths(7)+filenames(7) - PRINTF,unit,Ntrans - FOR I=0,Ntrans-1 DO BEGIN - PRINTF,unit,Xtrans(I),Ytrans(I) - ENDFOR - CLOSE,unit - FREE_LUN,unit - SPAWN,'transect' - GET_LUN,unit - OPENR,unit,'transect.tra' - READF,unit,Ntrans - x=0. - y=0. - z=0. - i1=0 - i2=0 - i3=0 - a=0. - b=0. - c=0. - FOR I=0,Ntrans-1 DO BEGIN - READF,unit,x,y,z,i1,i2,i3,a,b,c - print,I,x,y,z,i1,i2,i3,a,b,c - Ztrans(I)=z - Itrans(I,0)=i1 - Itrans(I,1)=i2 - Itrans(I,2)=i3 - COtrans(I,0)=a - COtrans(I,1)=b - COtrans(I,2)=c - ENDFOR - CLOSE,unit - FREE_LUN,unit - ENDIF ELSE BEGIN - FOR I=0,Ntrans-1 DO BEGIN - ;print,'dx:',dx,dy,sx,sy,Xtrans(I)/dx,Ytrans(I)/dy - Ztrans(I)=gd(FLOOR(Xtrans(I)/dx),FLOOR(Ytrans(I)/dy)) - ENDFOR - ENDELSE - TransOK=1 - END - 'Delete points':BEGIN - selec=WIDGET_INFO(WTGrideditor(1),/TABLE_SELECT) - idel=selec(3)-selec(1)+1 - WIDGET_CONTROL,WTGrideditor(1),/DELETE_ROWS - ntransgp=ntransgp-idel - print,'del :',ntransgp,idel - tempo=gridtmat - gridtmat=FLTARR(7,ntransgp) - IF selec(1) GT 0 THEN gridtmat(*,0:selec(1)-1)=tempo(*,0:selec(1)-1) - gridtmat(*,selec(1):ntransgp-1)=tempo(*,selec(3)+1:ntransgp+idel-1) - tempo=spectransname - spectransname=STRARR(nspecgp) - spectransname(0:selec(1)-1)=tempo(0:selec(1)-1) - spectransname(selec(1):ntransgp-1)=tempo(selec(3)+1:ntransgp+idel-1) - igpt=0 - WIDGET_CONTROL,WTline2(1),SET_SLIDER_MAX=ntransgp,value=1 - WIDGET_CONTROL,WTline2(2),SET_VALUE=spectransname(0) - Displaytgrid - END - 'Save transect':BEGIN - trfile=PICKFILE(/WRITE, FILTER = '*.tr') - IF trfile NE '' THEN BEGIN - GET_LUN,unit - OPENW,unit,trfile - PRINTF,unit,Ntrans,NtransGP,transsym,transsymsize, $ - transline,transthick - FOR I=0,Ntrans-1 DO PRINTF,unit,Strans(I),Xtrans(I),Ytrans(I), $ - Ztrans(I),TRANSPOSE(Itrans(I,*)),TRANSPOSE(COtrans(I,*)) - FOR I=0,Ntransgp-1 DO PRINTF,unit,Ispectrans(I), $ - gridtmat(*,I),spectransname(I) - CLOSE,unit - FREE_LUN,unit - ENDIF - END - 'Load transect':BEGIN - trfile=PICKFILE(/READ, FILTER = '*.tr') - IF trfile NE '' THEN BEGIN - GET_LUN,unit - OPENR,unit,trfile - READF,unit,Ntrans,NtransGP,transsym,transsymsize,transline,transthick - Strans=FLTARR(Ntrans) - Xtrans=FLTARR(Ntrans) - Ytrans=FLTARR(Ntrans) - Ztrans=FLTARR(Ntrans) - Itrans=INTARR(Ntrans,3) - COtrans=FLTARR(Ntrans,3) - s=0. - x=0. - y=0. - z=0. - i1=0 - i2=0 - i3=0 - co1=0. - co2=0. - co3=0. - FOR I=0,Ntrans-1 DO BEGIN - READF,unit,s,x,y,z,i1,i2,i3,co1,co2,co3 - Strans(I)=s - Xtrans(I)=x - Ytrans(I)=y - Ztrans(I)=z - Itrans(I,0)=i1 - Itrans(I,1)=i2 - Itrans(I,2)=i3 - COtrans(I,0)=co1 - COtrans(I,1)=co2 - COtrans(I,2)=co3 - ENDFOR - - Ispectrans=INTARR(Ntransgp) - spectransname=STRARR(Ntransgp) - gridtmat=FLTARR(7,Ntransgp) - vecteur=FLTARR(7) - i1=0 - name=' ' - FOR I=0,Ntransgp-1 DO BEGIN - READF,unit,i1,vecteur,name - Ispectrans(I)=i1 - gridtmat(*,I)=vecteur - spectransname(I)=name - ENDFOR - CLOSE,unit - FREE_LUN,unit - transOK=1 - ENDIF - END - 'Generate Transect': BEGIN - GenerateTransect - END - ENDCASE - END - 'WIDGET_TABLE_CH': BEGIN - print,'Ev:',ev - print,'type:',ev.type,ev.id,ev.x,ev.y - CASE (ev.id) OF - WTgrideditor(1):IF (ev.type LE 2) THEN BEGIN - WIDGET_CONTROL,ev.id, GET_VALUE=valeur, $ - USE_TABLE_SELECT=[ev.x,ev.y,ev.x,ev.y] - gridtmat(ev.X,ev.Y)=valeur(0,0) - Updatettable,ev.X,ev.Y - ENDIF - ENDCASE - END - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE ev.id OF - WTline1(1):BEGIN - ntransgp=FLOOR(FLOAT(value(0))) - if Ntrans LT ntransgp THEN Ntrans=ntransgp - WIDGET_CONTROL,WTline1(3),SET_VALUE=STRCOMPRESS(STRING(Ntrans)) - taille=size(gridtmat) - IF (ntransgp GT taille(2)) THEN $ - WIDGET_CONTROL,WTGrideditor(1), $ - INSERT_ROWS=(ntransgp-taille(2)) ;,/USE_TABLE_SELECT - IF (ntransgp LT taille(2)) THEN BEGIN - selec=[0,ntransgp,7,taille(2)-1] - WIDGET_CONTROL,WTGrideditor(1),/DELETE_ROWS,USE_TABLE_SELECT=selec - ENDIF - tempo=gridtmat - taille=size(gridtmat) - nmax=MIN([taille(2)-1,ntransgp-1]) - gridtmat=FLTARR(7,ntransgp) - gridtmat(*,0:nmax)=tempo(*,0:nmax) - tempo=spectransname - spectransname=STRARR(ntransgp) - spectransname(0:nmax)=tempo(0:nmax) - igpt=0 - WIDGET_CONTROL,WTline2(1),SET_SLIDER_MAX=ntransgp - WIDGET_CONTROL,WTline2(2),SET_VALUE=spectransname(0) - Displaytgrid - END - WTline1(3):BEGIN - ntrans=FLOOR(FLOAT(value(0))) - END - WTline2(2):spectransname(igpt)=value(0) - WTline2(5):BEGIN - ispec=FIX(value(0))-1 - ;print,'specmat:',specmat(*,ispec) - gridtmat(0:6,igpt)=specmat(0:6,ispec) - spectransname(igpt)=specname(ispec) - WIDGET_CONTROL,WTline2(2),SET_VALUE=spectransname(igpt) - Displaytgrid - END - WTline2(7):transsym=ROUND(FLOAT(value(0))) - WTline2(9):transsymsize=FLOAT(value(0)) - WTline2(11):transline=ROUND(FLOAT(value(0))) - WTline2(13):transthick=ROUND(FLOAT(value(0))) - WTsl(4): IF RaysOK THEN BEGIN - END - ENDCASE - END - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WPline1(2) : c_repart=ev.index - ENDCASE - END - 'WIDGET_SLIDER': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - WTline2(1): BEGIN - igpt=FLOAT(value)-1 - WIDGET_CONTROL,WTline2(2),SET_VALUE=spectransname(igpt) - END - ENDCASE - END - ELSE: - ENDCASE -; ENDELSE -RETURN -END - -;---------------------------------------------------------------------------- -PRO UpdateTTable,I,J -COMMON TRANSLOC,igpt,thetatrans,gridtmat,transtype -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused -COMMON WTwidgets,WTline1,WTline2,WTline4,WTgrideditor - ;IF I EQ 0 THEN BEGIN - ; gridtmat(1:4,J)=gridmat(1:4,c_gp) - ;ENDIF ELSE BEGIN - londeg=0 - lonmin=0. - latdeg=0 - latmin=0. - x=0. - y=0. - IF I LT 3 THEN BEGIN - XYtoLatLon,x,y,latdeg,latmin,londeg,lonmin,latlonstring - gridtmat(3,J)=latdeg - gridtmat(4,J)=latmin - gridtmat(5,J)=londeg - gridtmat(6,J)=lonmin - ENDIF ELSE BEGIN - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - gridtmat(1,J)=x - gridtmat(2,J)=y - ENDELSE - ;ENDELSE - WIDGET_CONTROL,WTgrideditor(1),SET_VALUE=gridtmat(0:6,J:J), $ - USE_TABLE_SELECT=[0,J,6,J] - print,'new values:',gridtmat(0:6,J:J) - RETURN -END - -;---------------------------------------------------------------------------- -PRO GenerateTransect ;generates a transect -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON TRANSLOC,igpt,thetatrans,gridtmat,transtype - N2=Ntrans-ntransGP - Strans0=FLTARR(Ntrans) - Ispectrans=FLTARR(Ntransgp) - Strans0(0)=0. - FOR I=1,ntransgp-1 DO BEGIN - ds=SQRT((gridtmat(1,I-1)-gridtmat(1,I))^2 +(gridtmat(2,I-1)-gridtmat(2,I))^2) - Strans0(I)=Strans0(I-1)+ds - ENDFOR - STRANS0(ntransgp:ntrans-1)=(Strans0(ntransgp-1))/(N2+1)+FINDGEN(N2)*(Strans0(ntransgp-1))/(N2+1) - sorted=SORT(STRANS0) - Strans=Strans0(sorted) - FOR I=0,ntransgp-1 DO BEGIN - Index=WHERE(strans EQ Strans0(I),kount) - IF kount NE 0 THEN Ispectrans(I)=Index(0) - ENDFOR - Xtrans=FLTARR(Ntrans) - Ytrans=FLTARR(Ntrans) - Xtrans(0)=gridtmat(1,0) - Ytrans(0)=gridtmat(2,0) - Xtrans(Ntrans-1)=gridtmat(1,ntransgp-1) - Ytrans(Ntrans-1)=gridtmat(2,ntransgp-1) - FOR I=1,ntransgp-1 DO BEGIN - FOR J=Ispectrans(I-1)+1,Ispectrans(I) DO BEGIN - Xtrans(J)=gridtmat(1,I-1)+ $ - (gridtmat(1,I)-gridtmat(1,I-1))* $ - (Strans(J)-Strans0(I-1))/(Strans0(I)-Strans0(I-1)) - Ytrans(J)=gridtmat(2,I-1)+ $ - (gridtmat(2,I)-gridtmat(2,I-1))* $ - (Strans(J)-Strans0(I-1))/(Strans0(I)-Strans0(I-1)) - ENDFOR - ENDFOR -END - -;---------------------------------------------------------------------------- -PRO DisplayTgrid -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON TRANSLOC,igpt,thetatrans,gridtmat,transtype -COMMON WTwidgets,WTline1,WTline2,WTline4,WTgrideditor - WIDGET_CONTROL,WTGrideditor(1),TABLE_YSIZE=ntransgp - WIDGET_CONTROL,USE_TABLE_SELECT=[-1,-1,8,ntransgp-1], $ - COLUMN_WIDTHS=[40,40,40,80,80,40,80,40,80] - ROWLAB=STRCOMPRESS(STRING(FINDGEN(ntransgp)+1,FORMAT='(I3)')) - gridf=STRARR(9,ntransgp) - gridf(0,*)='(I5)' - gridf(1:2,*)='(F8.2)' - gridf(3,*)='(I4)' - gridf(4,*)='(F8.3)' - gridf(5,*)='(I4)' - gridf(6,*)='(F8.3)' - - WIDGET_CONTROL,WTGrideditor(1),FORMAT=gridf,ROW_LABELS=ROWLAB - WIDGET_CONTROL,WTGrideditor(1), $ - USE_TABLE_SELECT=[0,0,6,ntransgp-1], $ - SET_VALUE=gridtmat(0:6,0:ntransgp-1) -END diff --git a/model/aux/idl_twist/mapping.pro b/model/aux/idl_twist/mapping.pro deleted file mode 100644 index 596bf0406..000000000 --- a/model/aux/idl_twist/mapping.pro +++ /dev/null @@ -1,99 +0,0 @@ -PRO Mapping, anterior_root -; This procedure creates the widged for the "mapping parameters" subwindow -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -;** 4 ** subwindow widgets widgets -COMMON WMap,WMapping,rootmtool -;*******END OF COMMON BLOCKS******************************* - pbase=LONG(0) - vecbase=LONG(0) - WMLines=LONARR(10) - WMapping=LONARR(10,10) - -; Guardar valores en variables temporales - rootmtool=anterior_root -; WIDGET_CONTROL, root, SENSITIVE=0 - - - pbase = WIDGET_BASE(TITLE='Mapping parameters', /COLUMN) - - i=0 - WMLines(i)=WIDGET_BASE(pbase, /FRAME, /ROW) - WMapping(i,0)=WIDGET_DROPLIST(WMLines(i), $ - VALUE=['No map projection','Use map projection']) - WMapping(i,1)=WIDGET_DROPLIST(WMLines(i), $ - VALUE=['Orthographic','Mollweide','Mercator','Azimuthal']) - WMapping(i,2)=WIDGET_DROPLIST(WMLines(i), $ - VALUE=['No continents','Continents outline','Filled continents']) - i=1 - WMLines(i)=WIDGET_BASE(pbase, /FRAME, /ROW) - WMapping(i,0) = WIDGET_SLIDER(WMlines(I), MAXIMUM=180, MINIMUM=-180, $ - value=MAPLONGCENTER,TITLE='Longitude of center') - WMapping(i,1) = WIDGET_SLIDER(WMlines(I), MAXIMUM=90, MINIMUM=-90, $ - value=MAPLATCENTER,TITLE='Latitude of center') - i=i+1 - WMLines(i)= WIDGET_BUTTON(pbase, VALUE='OK') - WIDGET_CONTROL, /REALIZE, pbase - XMANAGER, 'Mappingg', pbase - subwin(6)=1 -RETURN -END - - -;---------------------------------------------------------------------------- -PRO Mappingg_event, ev -;*******COMMON BLOCKS************************************** -;** 1 ** Display parameters -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -;** 4 ** subwindow widgets widgets -COMMON WMap,WMapping,rootmtool -;*******END OF COMMON BLOCKS******************************* - - type = TAG_NAMES(ev, /STRUCTURE) - ;print,'type:',type - CASE type OF - 'WIDGET_BUTTON': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'OK': BEGIN - WIDGET_CONTROL, /DESTROY, ev.top - WIDGET_CONTROL,rootmtool, SENSITIVE=1 - subwin(6)=0 - RETURN - END - ENDCASE - END - 'WIDGET_SLIDER': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - WMapping(1,0): MAPLONGCENTER=FLOAT(value) - WMapping(1,1): MAPLATCENTER=FLOAT(value) - ENDCASE - doplot - END - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WMapping(0,0): BEGIN - MAPFLAG=ev.index - doplot - END - WMapping(0,1): BEGIN - MAPPROJ=ev.index - doplot - END - WMapping(0,2): BEGIN - MAPCONTINENT=ev.index - doplot - END - ENDCASE - END - ENDCASE -RETURN -END - - diff --git a/model/aux/idl_twist/palette.pro b/model/aux/idl_twist/palette.pro deleted file mode 100755 index 3f2cf9c9f..000000000 --- a/model/aux/idl_twist/palette.pro +++ /dev/null @@ -1,614 +0,0 @@ -; $Id: xpalette.pro,v 1.18 1998/08/20 15:02:24 alan Exp $ -; -; Copyright (c) 1992-1998, Research Systems, Inc. All rights reserved. -; Unauthorized reproduction prohibited. -; Modified by Fabrice Ardhuin, August 1999 -;+ -; NAME: -; XPALETTE -; -; PURPOSE: -; Interactively create color tables using the RGB, CMY, HSV, and -; HLS color systems using the mouse, three sliders, and a cell -; for each color index. Single colors can be defined or multiple -; color indices between two endpoints can be interpolated. -; -; CATEGORY: -; Color tables, widgets. -; -; CALLING SEQUENCE: -; XPALETTE -; -; INPUTS: -; No explicit inputs. The current color table is used as a starting -; point. -; -; KEYWORD PARAMETERS: -; BLOCK: Set this keyword to have XMANAGER block when this -; application is registered. By default the Xmanager -; keyword NO_BLOCK is set to 1 to provide access to the -; command line if active command line processing is available. -; Note that setting BLOCK for this application will cause -; all widget applications to block, not only this -; application. For more information see the NO_BLOCK keyword -; to XMANAGER. -; UPDATECALLBACK: Set this keyword to a string containing the name of -; a user-supplied procedure that will be called when the color -; table is updated by XLOADCT. The procedure may optionally -; accept a keyword called DATA, which will be automatically -; set to the value specified by the optional UPDATECBDATA -; keyword. -; UPDATECBDATA: Set this keyword to a value of any type. It will be -; passed via the DATA keyword to the user-supplied procedure -; specified via the UPDATECALLBACK keyword, if any. If the -; UPDATECBDATA keyword is not set the value accepted by the -; DATA keyword to the procedure specified by UPDATECALLBACK -; will be undefined. -; -; OUTPUTS: -; None. -; -; COMMON BLOCKS: -; COLORS: Contains the current RGB color tables. -; XP_COM: Private to this module. -; -; SIDE EFFECTS: -; XPALETTE uses two colors from the current color table as -; drawing foreground and background colors. These are used -; for the RGB plots on the left, and the current index marker on -; the right. This means that if the user set these two colors -; to the same value, the XPALETTE display could become unreadable -; (like writing on black paper with black ink). XPALETTE minimizes -; this possibility by noting changes to the color map and always -; using the brightest available color for the foreground color -; and the darkest for the background. Thus, the only way -; to make XPALETTE's display unreadable is to set the entire color -; map to a single color, which is highly unlikely. The only side -; effect of this policy is that you may notice XPALETTE redrawing -; the entire display after you've modified the current color. -; This simply means that the change has made XPALETTE pick new -; drawing colors. -; -; The new color tables are saved in the COLORS common and loaded -; to the display. -; -; PROCEDURE: -; The XPALETTE widget has the following controls: -; -; Left: Three plots showing the current Red, Green, and Blue vectors. -; -; Center: A status region containing: -; 1) The total number of colors. -; 2) The current color. XPALETTE allows changing -; one color at a time. This color is known as -; the "current color" and is indicated in the -; color spectrum display with a special marker. -; 3) The current mark index. The mark is used to -; remember a color index. It is established by -; pressing the "Set Mark Button" while the current -; color index is the desired mark index. -; 4) The current color. The special marker used in -; color spectrum display prevents the user from seeing -; the color of the current index, but it is visible -; here. -; -; A panel of control buttons, which do the following when -; pressed: -; -; Done: Exits XPALETTE. -; -; Predefined: Starts XLOADCT to allow selection of one of the -; predefined color tables. -; -; Help: Supplies help information similar to this header. -; -; Redraw: Completely redraws the display using the current -; state of the color map. -; -; Set Mark: Set the value of the mark index to the -; current index. -; -; Switch Mark: Exchange the mark and the current index. -; -; Copy Current: Every color lying between the current -; index and the mark index (inclusive) is given -; the current color. -; -; Interpolate: The colors lying between the current -; index and the mark index are interpolated linearly -; to lie between the colors of two endpoints. -; -; Three sliders (R, G, and B) that allow the user to modify the -; current color. -; -; Right: A display which shows the current color map as a series of -; squares. Color index 0 is at the upper left. The color index -; increases monotonically by rows going left to right and top -; to bottom. The current color index is indicated by a special -; marker symbol. There are 4 ways to change the current color: -; 1) Press any mouse button while the mouse -; pointer is over the color map display. -; 2) Use the "By Index" slider to move to -; the desired color index. -; 3) Use the "Row" Slider to move the marker -; vertically. -; 4) Use the "Column" Slider to move the marker -; horizontally. -; -; MODIFICATION HISTORY: -; July 1990, AB. Based on the PALETTE procedure, which does -; similar things using only basic IDL graphics -; commands. -; -; 7 January 1991, Re-written for general use. -; 1 April 1992, Modified to use the CW_RGBSLIDER and CW_COLORSEL -; compound widgets. The use of color systems other than -; RGB is now supported. -; 15 June 1992, Modified to use the CW_FIELD and CW_BGROUP compound -; widgets. -; 7 April 1993, Removed state caching. Fixed a bug where switching -; the current index and the mark would fail to update the -; current index label. -; 10 March 1997, Added !X.TYPE and !Y.TYPE to saved state. -; 8/20/98, ACY - Added UPDATECALLBACK and UPDATECBDATA keywords. -; 4/21/99 added writing file -;- - -function XP_NEW_COLORS -; Choose the best foreground and background colors for the current -; color maps and set !P appropriately. Returns 1 if the colors changed, -; 0 otherwise. - common xp_com, xpw, state - - res = 0 - junk = CT_LUMINANCE(dark=dark_col, bright=bright_col) - - if (bright_col ne !p.color) then begin - !p.color = bright_col - res = 1 - endif - - if (dark_col ne !p.background) then begin - !p.background = dark_col - res = 1 - endif - - return, res -end - -pro XP_ALERT_CALLER - - common xp_com, xpw, state - - ErrorStatus = 0 - CATCH, ErrorStatus - if (ErrorStatus NE 0) then begin - CATCH, /CANCEL - v = DIALOG_MESSAGE(['Unexpected error in XPALETTE:', $ - '!ERR_STRING = ' + !ERR_STRING], $ - /ERROR) - return - endif - if (STRLEN(state.updt_callback) gt 0) then begin - if (PTR_VALID(state.p_updt_cb_data)) then begin - CALL_PROCEDURE, state.updt_callback, DATA=*(state.p_updt_cb_data) - endif else begin - CALL_PROCEDURE, state.updt_callback - endelse - endif -end - -pro XP_XLCTCALLBACK - ; For visuals with static colormaps, update the graphics - ; after a change by XLOADCT. - if ((COLORMAP_APPLICABLE(redrawRequired) GT 0) and $ - (redrawRequired GT 0)) then begin - XP_REDRAW - endif - -end - -pro XP_REDRAW - - common xp_com, xpw, state - - junk = XP_NEW_COLORS() - WIDGET_CONTROL, xpw.colorsel, set_value=-1 - XP_REPLOT, !p.color, 'F' ; Update the plots of RGB - ; Let the caller of XPALETTE know that the color table was modified - XP_ALERT_CALLER -end - - - -pro XP_REPLOT, color_index, type -; Re-draw the RGB plots. Type has the following possible values. -;; - 'D': Draw the data part of all three plots -; - 'F': draw all three plots -; - 'R': Draw the data part of the Red plot -; - 'G': Draw the data part of the Green plot -; - 'B': Draw the data part of the Blue plot - - common xp_com, xpw, state - common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - common pscale, r_x_s, r_y_s, g_x_s, g_y_s, b_x_s, b_y_s - - ; Update the plots of RGB - save_win = !D.WINDOW - wset, state.plot_win - save_p_region = !p.region - save_x_margin = !x.margin - save_y_margin = !y.margin - save_x_s = !x.s - save_y_s = !y.s - save_x_type = !x.type - save_y_type = !y.type - - !y.margin= [2, 2] - !x.margin= [6, 2] - - if (type eq 'F') then begin - !p.region = [0,.6667, 1, 1] - plot,xstyle=2, ystyle=3, yrange=[0, 260], r_curr, title='Red' - r_x_s = !x.s - r_y_s = !y.s - - !p.region = [0,.333, 1, .6667] - plot,/noerase, xstyle=2,ystyle=3, yrange=[0, 260], g_curr, title='Green' - g_x_s = !x.s - g_y_s = !y.s - - !p.region = [0,0, 1, .333] - plot,/noerase, xstyle=2,ystyle=3, yrange=[0, 260], b_curr, title='Blue' - - b_x_s = !x.s - b_y_s = !y.s - endif else begin - if ((type eq 'D') or (type eq 'R')) then begin - !p.region = [0,.6667, 1, 1] - !x.s = r_x_s - !y.s = r_y_s - oplot, r_curr, color=color_index - endif - if ((type eq 'D') or (type eq 'G')) then begin - !p.region = [0,.333, 1, .6667] - !x.s = g_x_s - !y.s = g_y_s - oplot, g_curr, color=color_index - endif - if ((type eq 'D') or (type eq 'B')) then begin - !p.region = [0,0, 1, .333] - !x.s = b_x_s - !y.s = b_y_s - oplot, b_curr, color=color_index - endif - endelse - - empty - WSET, save_win - !p.region = save_p_region - !x.margin = save_x_margin - !y.margin = save_y_margin - !x.s = save_x_s - !y.s = save_y_s - !x.type = save_x_type - !y.type = save_y_type - -end - - - - -pro XP_CHANGE_COLOR, type, value -; Change current color. Type has the following possible values. -; - 'R': Change the R part of the current color -; - 'G': ... -; - 'B': ... - common xp_com, xpw, state - common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - - - cur_idx = state.cur_idx - - XP_REPLOT, !p.background, type - - if (type eq 'R') then r_curr[cur_idx] = value; - if (type eq 'G') then g_curr[cur_idx] = value; - if (type eq 'B') then b_curr[cur_idx] = value; - - tvlct, r_curr[cur_idx], g_curr[cur_idx], b_curr[cur_idx], cur_idx - - if (XP_NEW_COLORS()) then begin - ; Highlight the current position using the marker - WIDGET_CONTROL, xpw.colorsel, set_value=-1 ; Re-initialize - XP_REPLOT, !p.color, 'F' - endif else begin - XP_REPLOT, !p.color, type - endelse - - ; For visuals with static colormaps, update the graphics - ; of the current color. - if ((COLORMAP_APPLICABLE(redrawRequired) GT 0) and $ - (redrawRequired GT 0)) then begin - ; Mark new square - tmp = !D.WINDOW - wset, state.cur_color_win - erase, color=state.cur_idx - wset, tmp - endif - - ; Let the caller of XPALETTE know that the color table was modified - xp_alert_caller - -end - - - - - - - -pro XP_BUTTON_EVENT, event - - common xp_com, xpw, state - common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - - ; NOTE: The value of these tags depend on the order of the buttons - ; in the base. - case (event.value) of - - ; DONE - 0: begin - empty - r_orig = r_curr & g_orig = g_curr & b_orig = b_curr ;new orig color tbl - WIDGET_CONTROL, /DESTROY, event.top - !p = state.old_p - end - - ; PREDEFINED - 1: xloadpalette, /silent, group=xpw.base, UPDATECALLBACK='XP_XLCTCALLBACK' - - ; HELP - 2: XDisplayFile, FILEPATH("xpalette.txt", subdir=['help', 'widget']), $ - TITLE = "XPalette Help", GROUP = event.top, WIDTH = 55, HEIGHT = 16 - - ; REDRAW - 3: XP_REDRAW - - ; SET MARK - 4: begin - state.mark_idx = state.cur_idx - WIDGET_CONTROL, xpw.mark_label, $ - set_value=strcompress(state.mark_idx, /REMOVE) - end - - ; SWITCH MARK - 5 : if (state.mark_idx ne state.cur_idx) then begin - tmp = state.mark_idx - state.mark_idx = state.cur_idx - state.cur_idx = tmp - WIDGET_CONTROL, xpw.colorsel, set_value=tmp - WIDGET_CONTROL, xpw.idx_label, $ - set_value=strcompress(state.cur_idx, /REMOVE) - WIDGET_CONTROL, xpw.mark_label, $ - set_value=strcompress(state.mark_idx, /REMOVE) - endif - - ; COPY CURRENT - 6 : begin - do_copy: - cur_idx = state.cur_idx - if (state.mark_idx le cur_idx) then begin - s = state.mark_idx - e = cur_idx - endif else begin - s = cur_idx - e = state.mark_idx - endelse - n = e-s+1 - XP_REPLOT, !p.background, 'D' - if (event.value eq 6) then begin - r_curr[s:e] = r_curr[cur_idx] - g_curr[s:e] = g_curr[cur_idx] - b_curr[s:e] = b_curr[cur_idx] - endif else begin ; Interpolate - scale = findgen(n)/float(n-1) - r_curr[s:e] = r_curr[s] + (fix(r_curr[e]) - fix(r_curr[s])) * scale - g_curr[s:e] = g_curr[s] + (fix(g_curr[e]) - fix(g_curr[s])) * scale - b_curr[s:e] = b_curr[s] + (fix(b_curr[e]) - fix(b_curr[s])) * scale - endelse - tvlct, r_curr[s:e], g_curr[s:e], b_curr[s:e], s - if (XP_NEW_COLORS()) then begin - WIDGET_CONTROL, xpw.colorsel, SET_VALUE=-1 - XP_REPLOT, !p.color, 'F' - endif else begin - XP_REPLOT, !p.color, 'D' - endelse - ; Let the caller of XPALETTE know that the color table was modified - xp_alert_caller - end - - 7: goto, do_copy - 8: BEGIN - file=DIALOG_PICKFILE(/READ, FILTER = '*.ct') - IF file NE '' THEN BEGIN - unitct=100 - OPENR,unitct,file - READF,unitct,nbclu - table0=intarr(nbclu,3) - READF,unitct,table0 - ;Interpolevels2,r_curr,table0(*,0),nbc - ;Interpolevels2,g_curr,table0(*,1),nbc - ;Interpolevels2,b_curr,table0(*,2),nbc - tvlct, r_curr, g_curr,b_curr - - END - END - 9: BEGIN - file=DIALOG_PICKFILE(/WRITE, FILTER = '*.ct') - IF file NE '' THEN BEGIN - unitct=100 - OPENW,unitct,file - END - END - else: - endcase - -end - - - - - - - -pro XP_EVENT, event - - common xp_com, xpw, state - common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - - case (event.id) of - - xpw.button_base: XP_BUTTON_EVENT, event - - xpw.rgb_base: begin - cur_idx = state.cur_idx - if (event.r ne r_curr[cur_idx]) then XP_CHANGE_COLOR, "R", event.r - if (event.g ne g_curr[cur_idx]) then XP_CHANGE_COLOR, "G", event.g - if (event.b ne b_curr[cur_idx]) then XP_CHANGE_COLOR, "B", event.b - end - - xpw.colorsel: begin - cur_idx = state.cur_idx - new_pos = event.value ne cur_idx - ; Update the RBG sliders - if (event.value ne cur_idx) then begin - state.cur_idx = (cur_idx = event.value) - WIDGET_CONTROL, xpw.idx_label, $ - set_value=strcompress(cur_idx, /REMOVE_ALL) - ; Mark new square - tmp = !D.WINDOW - wset, state.cur_color_win - erase, color=cur_idx - wset, tmp - - WIDGET_CONTROL, xpw.rgb_base, $ - set_value=[r_curr[cur_idx], g_curr[cur_idx], b_curr[cur_idx]] - endif - end - - else: - endcase - -end - - - - - - - -pro PALETTE, group=group, BLOCK=block, UPDATECALLBACK=updt_cb_name, $ - UPDATECBDATA=updt_cb_data - - - common xp_com, xpw, state - common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - - IF N_ELEMENTS(updt_cb_name) EQ 0 THEN updt_callback="" $ - ELSE updt_callback=updt_cb_name - IF N_ELEMENTS(updt_cb_data) GT 0 THEN p_updt_cb_data=PTR_NEW(updt_cb_data) $ - ELSE p_updt_cb_data=PTR_NEW() - - xpw = { xp_widgets, base:0L, $ - colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L} - - state = {old_p:!p, $ ; Original value of !P - mark_idx:0, $ ; Current mark index - cur_idx:0, $ ; Current index - cur_color_win:0, $ ; Current Color draw window index - plot_win:0, $ ; RGB plot draw window index - updt_callback: updt_callback, $ ; user-defined callback (optional) - p_updt_cb_data:p_updt_cb_data} ; data for callback (optional) - - if (XREGISTERED('XPALETTE')) then return ; Only one copy at a time - - IF N_ELEMENTS(block) EQ 0 THEN block=0 - - on_error,2 ;Return to caller if an error occurs - - nc = !d.table_size ;# of colors avail - if nc eq 0 then message, "Device has static color tables. Can't modify." - if (nc eq 2) then message, 'Unable to work with monochrome system.' - - state.old_p = !p ;Save !p - !p.noclip = 1 ;No clipping - !p.color = nc -1 ;Foreground color - !p.font = 0 ;Hdw font - save_win = !d.window ;Previous window - - IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors - TVLCT, r_orig, g_orig, b_orig, /GET - r_curr = r_orig - b_curr = b_orig - g_curr = g_orig - ENDIF - - ; Create widgets - xpw.base=WIDGET_BASE(title='XPalette', /ROW, space=30) - ; This is a little tricky. Setting the managed attribute indicates - ; our intention to put this app under the control of XMANAGER, and - ; prevents our draw widgets from becoming candidates for becoming - ; the default window on WSET, -1. XMANAGER sets this, but doing it here - ; prevents our own WSETs at startup from having that problem. - WIDGET_CONTROL, /MANAGED, xpw.base - - version = WIDGET_INFO(/VERSION) - if (version.style='Motif') then junk=510 else junk = 580 - plot_frame = WIDGET_DRAW(xpw.base, xsize=200, ysize=junk) - - c1 = WIDGET_BASE(xpw.base, /COLUMN, space=20) - status = WIDGET_BASE(c1, /COLUMN, /FRAME) - ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE) - xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $ - xsize=20, /STRING) - xpw.mark_label = CW_FIELD(status, title='Mark Index: ', value='0', $ - xsize=20, /STRING) - c1_1 = widget_base(status, /ROW) - junk = WIDGET_LABEL(c1_1, value="Current Color: ") - cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame) - names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $ - 'Switch Mark', 'Copy Current', 'Interpolate'] - xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME) - xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG) - - junk = WIDGET_BASE(xpw.base) ; Responds to YOFFSET - if (version.style='Motif') then junk2=30 else junk2 = 50 - xpw.colorsel = CW_COLORSEL(junk, yoffset=junk2) - - - state.cur_idx = 0 - state.mark_idx = 0 - - ; Position RGB slider appropriately - WIDGET_CONTROL, xpw.rgb_base, SET_VALUE=[r_curr[0], g_curr[0], b_curr[0]] - WIDGET_CONTROL, /REALIZE, xpw.base - - WIDGET_CONTROL, ncw, $ - set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL) - WIDGET_CONTROL, get_value=tmp, cur_color - state.cur_color_win = tmp - WIDGET_CONTROL, get_value=tmp, plot_frame - state.plot_win = tmp - - - ; Update the plots of RGB - junk = XP_NEW_COLORS() - XP_REPLOT, !p.color, 'F' - - WSET, save_win - - XMANAGER, 'XPalette', xpw.base, event_handler='XP_EVENT', group=group, $ - NO_BLOCK=(NOT(FLOAT(block))) -end - diff --git a/model/aux/idl_twist/palettes/6coul.ct b/model/aux/idl_twist/palettes/6coul.ct deleted file mode 100755 index 880da30dc..000000000 --- a/model/aux/idl_twist/palettes/6coul.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 129 0 0 255 255 255 31 36 40 45 50 54 58 61 64 68 69 72 - 74 77 79 80 82 83 85 84 86 87 88 86 87 87 87 85 84 84 84 - 83 79 78 77 76 71 70 68 66 60 58 55 53 46 43 40 36 33 25 - 21 16 12 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 4 8 12 21 25 29 33 42 46 51 55 63 - 67 72 76 80 89 93 97 101 110 114 119 123 131 135 140 144 153 157 161 - 165 169 178 182 187 191 199 203 208 212 221 225 229 233 242 246 250 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 0 0 223 132 67 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 4 8 16 21 25 29 38 42 46 51 55 63 67 72 - 76 84 89 93 97 106 110 114 119 127 131 135 140 144 152 157 161 165 174 - 178 182 187 195 199 203 208 216 220 225 229 233 242 246 250 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 250 - 242 238 233 229 221 216 212 208 199 195 191 187 178 174 170 165 161 153 148 - 144 140 131 127 123 119 110 106 102 97 89 85 80 76 72 63 59 55 51 - 42 38 34 29 21 17 12 8 0 - 0 218 255 0 0 130 0 28 32 38 43 48 53 59 63 68 72 77 81 - 86 91 95 100 104 109 113 118 122 127 132 136 141 145 150 154 159 163 168 - 173 177 182 186 191 195 200 204 209 214 218 223 227 232 236 241 245 250 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 242 238 - 233 225 220 216 212 203 199 195 191 187 178 174 170 165 157 152 148 144 135 - 131 127 123 114 110 106 102 97 89 84 80 76 67 63 59 55 46 42 38 - 34 25 21 16 12 8 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/Depth.ct b/model/aux/idl_twist/palettes/Depth.ct deleted file mode 100755 index fb5a55925..000000000 --- a/model/aux/idl_twist/palettes/Depth.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 204 183 178 173 168 163 158 153 148 143 138 133 128 123 118 118 112 112 - 107 107 102 102 97 97 92 87 87 82 82 77 77 71 71 66 66 61 61 - 56 56 51 51 46 46 41 41 35 35 30 30 25 25 20 15 15 10 10 - 5 5 0 0 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 - 20 22 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 42 - 42 40 40 38 38 37 37 35 34 34 32 32 30 30 29 29 27 27 26 - 26 24 24 22 22 21 21 19 19 18 18 16 16 15 14 14 13 13 12 - 12 10 10 9 9 8 8 24 24 40 40 57 57 73 73 90 90 106 106 - 123 123 139 156 156 163 163 169 169 176 176 182 182 189 189 195 195 202 202 - 209 209 215 215 222 222 228 228 235 241 241 248 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 203 - 0 166 129 122 115 108 101 94 87 79 72 65 58 51 44 37 37 42 42 - 48 48 53 53 59 59 64 69 69 75 75 80 80 85 85 91 91 96 96 - 101 101 107 107 112 112 118 118 123 123 128 128 134 134 139 144 144 150 150 - 155 155 161 161 164 164 168 168 172 172 176 176 180 180 185 185 189 189 193 - 193 197 202 202 208 208 215 215 221 221 228 228 235 235 241 241 248 248 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 251 251 247 247 - 244 244 240 240 237 237 233 233 230 230 226 226 222 222 219 215 215 212 212 - 208 208 205 205 201 201 198 198 187 187 176 176 165 165 154 154 143 143 132 - 132 122 122 111 100 100 89 89 78 78 67 65 65 65 65 65 66 66 66 - 66 66 67 67 67 67 67 68 141 - 0 255 241 239 237 234 232 230 228 225 223 221 218 216 214 212 212 213 213 - 215 215 217 217 219 219 221 223 223 225 225 227 227 228 228 230 230 232 232 - 234 234 236 236 238 238 240 240 241 241 243 243 245 245 247 249 249 251 251 - 253 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 249 249 244 244 238 238 233 227 227 222 222 216 216 211 211 205 205 200 - 200 194 194 189 189 183 183 178 178 173 173 155 155 138 121 121 103 103 86 - 86 69 69 51 51 34 34 39 39 44 44 50 50 55 55 60 60 66 66 - 71 71 76 82 82 80 80 78 78 77 77 75 75 73 73 72 72 70 70 - 68 68 67 67 65 65 63 63 62 60 60 58 58 57 57 58 58 59 59 - 60 60 62 62 63 63 64 64 66 66 67 67 68 68 70 71 71 72 72 - 74 74 75 75 76 76 78 78 81 81 84 84 87 87 90 90 93 93 96 - 96 99 99 102 105 105 108 108 111 111 114 109 106 103 100 98 95 92 89 - 87 84 81 78 76 73 70 68 52 diff --git a/model/aux/idl_twist/palettes/Depth_finistere.ct b/model/aux/idl_twist/palettes/Depth_finistere.ct deleted file mode 100755 index 0c3b77a02..000000000 --- a/model/aux/idl_twist/palettes/Depth_finistere.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 204 183 183 183 183 178 178 178 173 173 173 168 168 168 163 163 163 158 - 158 158 153 153 153 148 148 148 148 143 143 143 138 138 138 133 133 133 128 - 128 128 123 123 123 118 118 118 118 118 118 112 112 112 112 112 112 107 107 - 107 107 107 107 102 102 102 102 102 102 97 97 97 97 97 97 92 92 92 - 87 87 87 87 87 87 82 82 82 82 82 82 77 77 77 77 77 71 71 - 66 66 66 61 61 56 56 56 51 51 46 46 46 41 41 35 35 30 30 - 30 25 25 20 20 15 15 10 10 10 5 5 0 0 0 6 6 8 8 - 10 10 12 14 14 16 18 20 20 25 25 27 29 31 31 33 35 35 37 - 39 42 42 40 38 37 37 34 34 32 30 29 29 27 26 26 24 22 21 - 21 19 18 16 16 14 14 13 12 10 9 8 40 57 90 106 139 156 169 - 176 189 195 209 215 228 228 235 241 248 248 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 181 172 - 0 166 129 129 129 129 122 122 122 115 115 115 108 108 108 101 101 101 94 - 94 94 87 87 87 79 79 79 79 72 72 72 65 65 65 58 58 58 51 - 51 51 44 44 44 37 37 37 37 37 37 42 42 42 42 42 42 48 48 - 48 48 48 48 53 53 53 53 53 53 59 59 59 59 59 59 64 64 64 - 69 69 69 69 69 69 75 75 75 75 75 75 80 80 80 80 80 85 85 - 91 91 91 96 96 101 101 101 107 107 112 112 112 118 118 123 123 128 128 - 128 134 134 139 139 144 144 150 150 150 155 155 161 161 161 164 164 168 168 - 172 172 176 180 180 185 189 193 193 202 202 208 215 221 221 228 235 235 241 - 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 251 251 247 244 244 240 240 - 237 233 233 230 226 226 222 219 215 212 212 208 208 205 201 201 198 187 187 - 176 165 165 154 143 143 132 122 122 111 100 89 89 78 67 65 65 65 65 - 66 66 66 66 67 67 67 87 70 - 0 255 241 241 241 241 239 239 239 237 237 237 234 234 234 232 232 232 230 - 230 230 228 228 228 225 225 225 225 223 223 223 221 221 221 218 218 218 216 - 216 216 214 214 214 212 212 212 212 212 212 213 213 213 213 213 213 215 215 - 215 215 215 215 217 217 217 217 217 217 219 219 219 219 219 219 221 221 221 - 223 223 223 223 223 223 225 225 225 225 225 225 227 227 227 227 227 228 228 - 230 230 230 232 232 234 234 234 236 236 238 238 238 240 240 241 241 243 243 - 243 245 245 247 247 249 249 251 251 251 253 253 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 249 244 238 238 227 227 222 216 211 211 205 200 200 194 189 183 - 183 178 173 155 155 121 121 103 86 69 51 34 44 50 60 66 76 82 78 - 77 73 72 68 67 63 63 62 60 58 58 57 58 58 59 60 60 62 62 - 63 64 64 66 67 67 68 70 71 72 72 74 74 75 76 76 78 81 81 - 84 87 87 90 93 93 96 99 99 102 105 108 108 111 114 109 106 100 98 - 95 89 87 84 78 76 73 6 4 diff --git a/model/aux/idl_twist/palettes/Depth_land_lakes.ct b/model/aux/idl_twist/palettes/Depth_land_lakes.ct deleted file mode 100755 index a15bd2c91..000000000 --- a/model/aux/idl_twist/palettes/Depth_land_lakes.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 186 183 178 173 168 163 158 153 148 143 138 133 128 123 118 118 112 112 - 107 107 102 102 97 97 92 87 87 82 82 77 77 71 71 66 66 61 61 - 56 56 51 51 46 46 41 41 35 35 30 30 25 25 20 15 15 10 10 - 5 5 0 0 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 - 20 22 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 42 - 42 40 40 38 38 37 37 35 34 34 32 32 30 30 29 29 27 27 26 - 26 24 24 22 22 21 21 19 19 18 18 16 16 15 14 14 13 13 12 - 12 10 10 9 9 8 8 24 24 40 40 57 57 73 73 90 90 106 106 - 123 123 139 156 156 163 163 169 169 176 176 182 182 189 189 195 195 202 202 - 209 209 215 215 222 222 228 228 235 241 241 248 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 50 185 - 0 199 129 122 115 108 101 94 87 79 72 65 58 51 44 37 37 42 42 - 48 48 53 53 59 59 64 69 69 75 75 80 80 85 85 91 91 96 96 - 101 101 107 107 112 112 118 118 123 123 128 128 134 134 139 144 144 150 150 - 155 155 161 161 164 164 168 168 172 172 176 176 180 180 185 185 189 189 193 - 193 197 202 202 208 208 215 215 221 221 228 228 235 235 241 241 248 248 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 251 251 247 247 - 244 244 240 240 237 237 233 233 230 230 226 226 222 222 219 215 215 212 212 - 208 208 205 205 201 201 198 198 187 187 176 176 165 165 154 154 143 143 132 - 132 122 122 111 100 100 89 89 78 78 67 65 65 65 65 65 66 66 66 - 66 66 67 67 67 67 67 129 107 - 0 255 241 239 237 234 232 230 228 225 223 221 218 216 214 212 212 213 213 - 215 215 217 217 219 219 221 223 223 225 225 227 227 228 228 230 230 232 232 - 234 234 236 236 238 238 240 240 241 241 243 243 245 245 247 249 249 251 251 - 253 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 249 249 244 244 238 238 233 227 227 222 222 216 216 211 211 205 205 200 - 200 194 194 189 189 183 183 178 178 173 173 155 155 138 121 121 103 103 86 - 86 69 69 51 51 34 34 39 39 44 44 50 50 55 55 60 60 66 66 - 71 71 76 82 82 80 80 78 78 77 77 75 75 73 73 72 72 70 70 - 68 68 67 67 65 65 63 63 62 60 60 58 58 57 57 58 58 59 59 - 60 60 62 62 63 63 64 64 66 66 67 67 68 68 70 71 71 72 72 - 74 74 75 75 76 76 78 78 81 81 84 84 87 87 90 90 93 93 96 - 96 99 99 102 105 105 108 108 111 111 114 109 106 103 100 98 95 92 89 - 87 84 81 78 76 73 70 255 4 diff --git a/model/aux/idl_twist/palettes/Eb.ct b/model/aux/idl_twist/palettes/Eb.ct deleted file mode 100755 index d9c70f7a2..000000000 --- a/model/aux/idl_twist/palettes/Eb.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 255 242 229 216 203 190 190 177 164 151 138 125 125 125 101 101 94 88 - 82 75 69 63 56 50 44 37 31 25 18 12 6 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 4 - 5 6 7 8 9 10 12 13 13 15 16 17 19 20 20 22 23 24 26 - 27 27 29 31 33 34 37 39 41 44 54 61 67 74 84 91 97 104 114 - 121 127 137 141 144 151 154 158 164 168 171 178 181 184 191 194 198 204 208 - 211 218 221 224 231 234 241 241 244 244 248 248 251 251 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 0 - 255 255 235 216 197 177 158 158 139 119 100 81 62 62 62 31 31 29 27 - 25 23 21 19 17 15 13 11 9 7 5 3 1 0 7 15 23 31 38 - 46 54 62 69 77 85 93 101 108 116 124 132 139 147 155 163 171 178 186 - 194 202 209 217 225 233 241 255 255 255 255 255 255 255 255 254 253 252 251 - 250 250 248 248 247 246 245 244 243 242 241 241 239 238 238 236 236 235 234 - 233 232 231 229 228 227 224 223 222 221 223 224 225 226 227 228 230 231 232 - 233 234 236 236 237 238 239 239 240 241 241 242 243 243 244 245 245 247 247 - 248 249 249 250 251 251 252 252 253 253 253 253 254 254 255 255 252 252 249 - 249 247 247 244 244 241 241 239 239 236 236 234 234 231 231 228 226 226 223 - 221 221 218 215 215 213 210 210 207 205 205 202 200 200 197 194 194 192 189 - 189 187 184 184 181 179 179 176 174 165 165 165 165 165 165 161 161 161 148 - 148 148 148 148 140 140 140 127 127 127 127 127 127 119 119 119 110 110 110 - 110 102 102 89 89 89 89 80 80 72 72 72 59 59 55 55 55 55 42 - 42 34 34 34 0 0 0 0 0 - 255 255 250 245 240 235 230 230 225 220 215 210 205 205 205 195 195 198 202 - 206 210 213 217 221 225 228 232 236 240 243 247 251 255 254 253 252 251 250 - 249 248 247 246 245 245 244 243 242 241 240 239 238 237 236 236 235 234 233 - 232 231 230 229 228 227 227 242 242 233 220 220 199 199 199 195 192 189 183 - 180 176 170 167 164 161 154 151 148 142 138 135 129 126 123 116 113 110 104 - 101 97 91 85 78 72 63 56 50 46 44 42 41 39 37 35 34 33 30 - 29 27 25 24 24 22 22 21 19 19 18 16 16 15 13 13 12 11 10 - 9 8 7 6 5 4 2 2 2 2 1 1 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/Eb_for_eps.ct b/model/aux/idl_twist/palettes/Eb_for_eps.ct deleted file mode 100644 index 08a75ba15..000000000 --- a/model/aux/idl_twist/palettes/Eb_for_eps.ct +++ /dev/null @@ -1,39 +0,0 @@ - 0 255 242 229 216 203 190 190 177 164 151 138 125 125 125 101 101 94 88 82 - 75 69 63 56 50 44 37 31 25 18 12 6 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 4 5 6 7 8 - 9 10 12 13 13 15 16 17 19 20 20 22 23 24 26 27 27 29 31 33 - 34 37 39 41 44 54 61 67 74 84 91 97 104 114 121 127 137 141 144 151 - 154 158 164 168 171 178 181 184 191 194 198 204 208 211 218 221 224 231 234 241 - 241 244 244 248 248 251 251 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 - 0 255 235 216 197 177 158 158 139 119 100 81 62 62 62 31 31 29 27 25 - 23 21 19 17 15 13 11 9 7 5 3 1 0 7 15 23 31 38 46 54 - 62 69 77 85 93 101 108 116 124 132 139 147 155 163 171 178 186 194 202 209 - 217 225 233 241 255 255 255 255 255 255 255 255 254 253 252 251 250 250 248 248 - 247 246 245 244 243 242 241 241 239 238 238 236 236 235 234 233 232 231 229 228 - 227 224 223 222 221 223 224 225 226 227 228 230 231 232 233 234 236 236 237 238 - 239 239 240 241 241 242 243 243 244 245 245 247 247 248 249 249 250 251 251 252 - 252 253 253 253 253 254 254 255 255 252 252 249 249 247 247 244 244 241 241 239 - 239 236 236 234 234 231 231 228 226 226 223 221 221 218 215 215 213 210 210 207 - 205 205 202 200 200 197 194 194 192 189 189 187 184 184 181 179 179 176 174 165 - 165 165 165 165 165 161 161 161 148 148 148 148 148 140 140 140 127 127 127 127 - 127 127 119 119 119 110 110 110 110 102 102 89 89 89 89 80 80 72 72 72 - 59 59 55 55 55 55 42 42 34 34 34 0 0 0 0 255 - 0 255 250 245 240 235 230 230 225 220 215 210 205 205 205 195 195 198 202 206 - 210 213 217 221 225 228 232 236 240 243 247 251 255 254 253 252 251 250 249 248 - 247 246 245 245 244 243 242 241 240 239 238 237 236 236 235 234 233 232 231 230 - 229 228 227 227 242 242 233 220 220 199 199 199 195 192 189 183 180 176 170 167 - 164 161 154 151 148 142 138 135 129 126 123 116 113 110 104 101 97 91 85 78 - 72 63 56 50 46 44 42 41 39 37 35 34 33 30 29 27 25 24 24 22 - 22 21 19 19 18 16 16 15 13 13 12 11 10 9 8 7 6 5 4 2 - 2 2 2 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 diff --git a/model/aux/idl_twist/palettes/Hs.ct b/model/aux/idl_twist/palettes/Hs.ct deleted file mode 100755 index 95a5ef2e7..000000000 --- a/model/aux/idl_twist/palettes/Hs.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 154 154 148 148 143 143 138 138 133 133 128 128 123 123 118 118 112 112 - 107 107 102 102 97 97 92 87 87 82 82 77 77 71 71 66 66 61 61 - 56 56 51 51 46 46 41 41 35 35 30 30 25 25 20 15 15 10 10 - 5 5 0 0 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 - 20 22 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 42 - 42 40 40 38 38 37 37 35 34 34 32 32 30 30 29 29 27 27 26 - 26 24 24 22 22 21 21 19 19 18 18 16 16 15 14 14 13 13 12 - 12 10 10 9 9 8 8 24 24 40 40 57 57 73 73 90 90 106 106 - 123 123 139 156 156 163 163 169 169 176 176 182 182 189 189 195 195 202 202 - 209 209 215 215 222 222 228 228 235 241 241 248 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 122 - 0 0 0 5 5 10 10 16 16 21 21 26 26 32 32 37 37 42 42 - 48 48 53 53 59 59 64 69 69 75 75 80 80 85 85 91 91 96 96 - 101 101 107 107 112 112 118 118 123 123 128 128 134 134 139 144 144 150 150 - 155 155 161 161 164 164 168 168 172 172 176 176 180 180 185 185 189 189 193 - 193 197 202 202 208 208 215 215 221 221 228 228 235 235 241 241 248 248 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 251 251 247 247 - 244 244 240 240 237 237 233 233 230 230 226 226 222 222 219 215 215 212 212 - 208 208 205 205 201 201 198 198 187 187 176 176 165 165 154 154 143 143 132 - 132 122 122 111 100 100 89 89 78 78 67 67 57 57 48 48 40 40 32 - 32 24 24 16 16 8 8 0 43 - 0 199 199 200 200 202 202 204 204 206 206 208 208 210 210 212 212 213 213 - 215 215 217 217 219 219 221 223 223 225 225 227 227 228 228 230 230 232 232 - 234 234 236 236 238 238 240 240 241 241 243 243 245 245 247 249 249 251 251 - 253 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 249 249 244 244 238 238 233 227 227 222 222 216 216 211 211 205 205 200 - 200 194 194 189 189 183 183 178 178 173 173 155 155 138 121 121 103 103 86 - 86 69 69 51 51 34 34 39 39 44 44 50 50 55 55 60 60 66 66 - 71 71 76 82 82 80 80 78 78 77 77 75 75 73 73 72 72 70 70 - 68 68 67 67 65 65 63 63 62 60 60 58 58 57 57 58 58 59 59 - 60 60 62 62 63 63 64 64 66 66 67 67 68 68 70 71 71 72 72 - 74 74 75 75 76 76 78 78 81 81 84 84 87 87 90 90 93 93 96 - 96 99 99 102 105 105 108 108 111 111 114 114 117 117 100 100 83 83 66 - 66 50 50 33 33 16 16 0 8 diff --git a/model/aux/idl_twist/palettes/Hsb.ct b/model/aux/idl_twist/palettes/Hsb.ct deleted file mode 100755 index 01a563407..000000000 --- a/model/aux/idl_twist/palettes/Hsb.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 255 212 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 248 241 241 235 - 228 228 222 222 215 215 209 209 202 202 195 195 189 189 182 182 176 176 169 - 169 163 163 156 156 139 123 123 106 106 90 90 73 73 57 57 40 40 24 - 24 8 8 9 9 10 10 12 12 13 13 14 14 15 16 16 18 18 19 - 19 21 21 22 22 24 24 26 26 27 27 29 29 30 30 32 32 34 34 - 35 37 37 38 38 40 40 42 42 39 39 37 37 35 35 33 33 31 31 - 29 29 27 27 25 25 22 20 20 18 18 16 16 14 14 12 12 10 10 - 8 8 6 6 0 0 5 5 10 10 15 15 20 25 25 30 30 35 35 - 41 41 46 46 51 51 56 56 61 61 66 66 71 71 77 77 82 82 87 - 87 92 97 97 102 102 107 107 112 112 118 118 123 123 128 128 133 133 138 - 138 143 143 148 148 154 154 175 0 - 255 0 166 8 16 16 24 24 32 32 40 40 48 48 57 57 67 67 78 - 78 89 89 100 100 111 122 122 132 132 143 143 154 154 165 165 176 176 187 - 187 198 198 201 201 205 205 208 208 212 212 215 215 219 222 222 226 226 230 - 230 233 233 237 237 240 240 244 247 247 251 251 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 248 248 241 241 235 235 228 228 221 221 - 215 215 208 208 202 202 197 193 193 189 189 185 185 180 180 176 176 172 172 - 168 168 164 164 161 161 155 155 150 150 144 144 139 134 134 128 128 123 123 - 118 118 112 112 107 107 101 101 96 96 91 91 85 85 80 80 75 75 69 - 69 64 59 59 53 53 48 48 42 42 37 37 32 32 26 26 21 21 16 - 16 10 10 5 5 0 0 0 0 - 255 0 126 16 33 33 50 50 66 66 83 83 100 100 117 117 114 114 111 - 111 108 108 105 105 102 99 99 96 96 93 93 90 90 87 87 84 84 81 - 81 78 78 76 76 75 75 74 74 72 72 71 71 70 68 68 67 67 66 - 66 64 64 63 63 62 62 60 59 59 58 58 57 57 58 58 60 60 62 - 63 63 65 65 67 67 68 68 70 70 72 72 73 73 75 75 77 77 78 - 78 80 80 82 82 76 71 71 66 66 60 60 55 55 50 50 44 44 39 - 39 34 34 51 51 69 69 86 86 103 103 121 121 138 155 155 173 173 178 - 178 183 183 189 189 194 194 200 200 205 205 211 211 216 216 222 222 227 227 - 233 238 238 244 244 249 249 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 253 253 251 251 249 249 247 245 245 243 243 241 241 - 240 240 238 238 236 236 234 234 232 232 230 230 228 228 227 227 225 225 223 - 223 221 219 219 217 217 215 215 213 213 212 212 210 210 208 208 206 206 204 - 204 202 202 200 200 199 199 182 0 diff --git a/model/aux/idl_twist/palettes/Hsb2.ct b/model/aux/idl_twist/palettes/Hsb2.ct deleted file mode 100755 index b908ddfbd..000000000 --- a/model/aux/idl_twist/palettes/Hsb2.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 255 212 212 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 248 248 248 - 241 241 235 235 228 228 228 222 222 222 215 215 215 215 209 209 202 202 202 - 202 195 195 189 189 189 189 182 182 182 176 176 169 169 169 163 156 156 156 - 123 123 123 106 106 90 90 73 73 57 57 40 40 24 24 24 8 9 9 - 9 10 12 12 13 13 14 14 15 16 16 18 18 19 19 21 22 22 24 - 24 26 26 27 27 29 30 30 32 32 34 35 37 37 38 38 40 40 42 - 42 39 37 37 35 35 33 33 31 31 29 29 27 27 27 25 25 22 20 - 20 18 16 14 14 12 10 8 6 6 0 5 10 15 15 25 25 35 41 - 46 46 51 56 61 61 66 71 77 82 82 87 92 97 102 107 112 112 118 - 123 128 133 133 138 143 148 148 0 - 255 0 166 166 8 16 16 16 24 24 32 32 32 40 40 48 48 48 57 - 57 67 67 67 78 78 89 89 89 100 100 111 111 122 122 132 132 132 143 - 143 154 154 154 165 165 176 176 176 187 187 198 198 198 201 201 205 205 205 - 208 208 212 212 212 215 215 219 222 222 222 226 226 230 230 230 233 233 237 - 237 240 240 240 244 247 247 247 247 251 251 251 251 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 248 241 241 235 235 228 228 221 221 215 215 208 208 208 202 202 197 193 - 193 189 185 180 180 176 172 168 164 164 161 155 150 144 144 134 134 123 118 - 112 112 107 101 96 96 91 85 80 75 75 69 64 59 53 48 42 42 37 - 32 26 21 21 16 10 5 5 0 - 255 0 126 126 16 33 33 33 50 50 66 66 66 83 83 100 100 100 117 - 117 114 114 114 111 111 108 108 108 105 105 102 102 99 99 96 96 96 93 - 93 90 90 90 87 87 84 84 84 81 81 78 78 78 76 76 75 75 75 - 74 74 72 72 72 71 71 70 68 68 68 67 67 66 66 66 64 64 63 - 63 62 62 62 60 59 59 59 59 58 58 58 58 57 57 58 58 58 58 - 60 60 62 62 63 63 63 65 65 65 67 67 67 67 68 68 70 70 70 - 70 72 72 73 73 73 73 75 75 75 77 77 78 78 78 80 82 82 82 - 71 71 71 66 66 60 60 55 55 50 50 44 44 39 39 39 34 51 51 - 51 69 86 86 103 103 121 121 138 155 155 173 173 178 178 183 189 189 194 - 194 200 200 205 205 211 216 216 222 222 227 233 238 238 244 244 249 249 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 253 251 249 249 245 245 241 240 - 238 238 236 234 232 232 230 228 227 225 225 223 221 219 217 215 213 213 212 - 210 208 206 206 204 202 200 200 0 diff --git a/model/aux/idl_twist/palettes/JFM8a.ct b/model/aux/idl_twist/palettes/JFM8a.ct deleted file mode 100755 index 23833cfd6..000000000 --- a/model/aux/idl_twist/palettes/JFM8a.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 56 56 112 112 112 112 112 114 114 114 114 114 114 115 115 115 115 115 - 116 116 116 116 116 118 118 118 118 118 119 119 119 119 119 119 121 121 121 - 121 122 122 122 122 122 122 123 123 123 123 123 125 125 125 125 125 126 126 - 126 126 126 128 128 128 128 128 128 129 129 129 129 131 131 131 131 131 131 - 132 132 132 132 132 133 133 133 133 133 135 135 135 135 135 136 136 136 136 - 136 136 138 138 138 138 139 139 139 139 139 139 140 140 140 140 140 142 142 - 142 142 142 143 143 143 143 143 145 145 145 145 145 145 146 146 146 146 147 - 147 147 147 147 147 149 149 149 149 149 150 150 150 150 152 152 152 154 154 - 157 162 162 164 167 171 171 174 178 178 181 184 188 188 191 194 194 198 201 - 205 205 208 211 211 215 218 221 221 225 228 228 232 235 238 238 242 245 245 - 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 250 - 250 250 250 250 250 250 250 250 250 250 250 250 250 250 252 252 252 252 252 - 252 252 252 252 252 252 252 252 252 252 252 253 253 253 253 253 253 253 253 - 253 253 253 253 253 253 253 255 255 - 0 56 56 112 112 112 112 112 114 114 114 114 114 114 115 115 115 115 115 - 116 116 116 116 116 118 118 118 118 118 119 119 119 119 119 119 121 121 121 - 121 122 122 122 122 122 122 123 123 123 123 123 125 125 125 125 125 126 126 - 126 126 126 128 128 128 128 128 128 129 129 129 129 131 131 131 131 131 131 - 132 132 132 132 132 133 133 133 133 133 135 135 135 135 135 136 136 136 136 - 136 136 138 138 138 138 139 139 139 139 139 139 140 140 140 140 140 142 142 - 142 142 142 143 143 143 143 143 145 145 145 145 145 145 146 146 146 146 147 - 147 147 147 147 147 149 149 149 149 149 150 150 150 150 152 152 152 154 154 - 157 162 162 164 167 171 171 174 178 178 181 184 188 188 191 194 194 198 201 - 205 205 208 211 211 215 218 221 221 225 228 228 232 235 238 238 242 245 245 - 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 250 - 250 250 250 250 250 250 250 250 250 250 250 250 250 250 252 252 252 252 252 - 252 252 252 252 252 252 252 252 252 252 252 253 253 253 253 253 253 253 253 - 253 253 253 253 253 253 253 255 255 - 0 56 56 112 112 112 112 112 114 114 114 114 114 114 115 115 115 115 115 - 116 116 116 116 116 118 118 118 118 118 119 119 119 119 119 119 121 121 121 - 121 122 122 122 122 122 122 123 123 123 123 123 125 125 125 125 125 126 126 - 126 126 126 128 128 128 128 128 128 129 129 129 129 131 131 131 131 131 131 - 132 132 132 132 132 133 133 133 133 133 135 135 135 135 135 136 136 136 136 - 136 136 138 138 138 138 139 139 139 139 139 139 140 140 140 140 140 142 142 - 142 142 142 143 143 143 143 143 145 145 145 145 145 145 146 146 146 146 147 - 147 147 147 147 147 149 149 149 149 149 150 150 150 150 152 152 152 154 154 - 157 162 162 164 167 171 171 174 178 178 181 184 188 188 191 194 194 198 201 - 205 205 208 211 211 215 218 221 221 225 228 228 232 235 238 238 242 245 245 - 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 249 250 - 250 250 250 250 250 250 250 250 250 250 250 250 250 250 252 252 252 252 252 - 252 252 252 252 252 252 252 252 252 252 252 253 253 253 253 253 253 253 253 - 253 253 253 253 253 253 253 255 255 diff --git a/model/aux/idl_twist/palettes/SWAO_dir.ct b/model/aux/idl_twist/palettes/SWAO_dir.ct deleted file mode 100755 index 7c1af94c7..000000000 --- a/model/aux/idl_twist/palettes/SWAO_dir.ct +++ /dev/null @@ -1,39 +0,0 @@ - 0 255 200 197 195 193 191 189 187 185 182 180 178 176 174 172 170 170 170 170 - 164 164 164 164 164 158 158 158 158 158 161 161 161 161 163 163 163 163 165 165 - 165 165 167 170 172 176 179 183 185 188 192 194 194 194 199 199 199 199 199 199 - 190 190 186 186 186 182 182 182 182 178 174 169 165 165 161 157 157 157 153 153 - 153 153 153 149 145 140 140 140 140 136 132 132 128 128 128 128 124 109 103 91 - 79 79 79 79 79 79 73 73 73 73 73 67 67 67 67 67 67 61 61 61 - 61 61 55 55 55 55 55 50 6 28 35 57 72 94 102 124 130 158 172 186 - 192 199 206 213 213 220 227 234 234 241 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 0 255 200 196 192 189 185 182 178 175 171 167 164 160 157 153 150 150 150 150 - 137 137 137 137 137 124 124 124 124 124 119 119 119 119 113 113 113 113 108 108 - 108 108 102 97 91 80 75 64 58 53 42 36 36 36 2 2 2 2 2 2 - 3 3 4 4 4 5 5 5 5 5 6 7 8 8 8 9 9 9 10 10 - 10 10 10 11 11 12 12 12 12 13 14 14 14 14 14 14 15 27 34 47 - 60 60 60 60 60 60 67 67 67 67 67 74 74 74 74 74 74 80 80 80 - 80 80 87 87 87 87 87 94 225 231 233 239 243 249 251 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 250 244 235 231 218 214 207 197 188 - 186 182 173 173 169 167 161 148 144 127 123 110 97 97 97 97 97 59 59 59 - 42 42 34 34 34 17 17 17 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 - 0 255 200 198 197 195 194 193 191 190 189 187 186 185 183 182 181 181 181 181 - 178 178 178 178 178 175 175 175 175 175 179 179 179 179 184 184 184 184 188 188 - 188 188 193 197 202 210 215 224 228 233 242 246 246 246 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 67 65 64 62 61 59 58 54 51 40 34 28 - 25 22 20 17 17 14 11 8 8 5 2 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 diff --git a/model/aux/idl_twist/palettes/S_sym.ct b/model/aux/idl_twist/palettes/S_sym.ct deleted file mode 100755 index c6b680b72..000000000 --- a/model/aux/idl_twist/palettes/S_sym.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 85 82 78 78 75 66 62 62 57 54 50 47 41 38 34 29 26 22 - 19 13 10 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 12 12 25 25 38 50 50 63 76 76 76 76 88 88 88 - 101 114 114 114 114 114 114 114 114 114 126 126 126 126 139 139 152 152 152 - 152 152 165 165 165 165 165 165 189 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 5 5 6 6 7 9 9 9 10 11 12 13 14 14 15 16 17 18 - 18 20 20 22 22 22 23 37 37 37 66 66 66 81 95 95 110 110 124 - 139 139 139 153 168 182 182 197 211 211 226 240 240 240 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 241 241 241 241 241 228 228 228 - 228 214 214 214 214 214 214 201 201 201 201 188 188 188 174 174 174 174 174 - 174 161 161 161 161 161 161 148 148 148 127 127 127 127 127 127 127 127 127 - 110 110 110 110 110 102 102 102 102 102 102 89 89 89 80 80 80 80 80 - 72 72 72 59 59 59 59 59 59 59 55 55 55 55 55 55 42 34 34 - 34 34 34 34 0 0 0 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 239 239 223 223 - 207 191 191 191 175 159 159 143 127 127 111 95 79 79 79 63 63 47 47 - 31 15 15 15 12 12 25 25 38 50 50 63 76 76 76 76 88 88 88 - 101 114 114 114 114 114 114 114 114 114 126 126 126 126 139 139 152 152 152 - 152 152 165 165 165 165 165 165 189 223 223 223 223 223 223 195 195 195 195 - 195 167 167 167 139 139 139 139 111 111 111 111 111 111 83 83 83 83 55 - 55 55 55 27 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/Tp_SAR.ct b/model/aux/idl_twist/palettes/Tp_SAR.ct deleted file mode 100644 index 55fbf6510..000000000 --- a/model/aux/idl_twist/palettes/Tp_SAR.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 181 174 168 162 156 150 144 138 132 126 114 108 102 96 90 84 78 72 66 - 60 48 42 36 30 24 18 12 6 0 0 18 31 40 54 61 69 74 80 83 - 84 88 85 84 79 77 70 66 55 46 40 25 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 4 12 29 42 55 67 80 93 101 - 119 131 144 157 169 182 199 208 225 246 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 175 174 174 - 174 174 174 174 174 174 174 174 174 174 174 174 174 173 173 173 173 173 173 173 - 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 - 173 172 172 172 172 172 172 172 172 172 172 172 172 172 172 172 172 172 172 172 - 173 173 174 174 175 176 176 177 177 178 178 179 179 180 180 181 182 182 182 183 - 183 184 184 185 185 186 187 187 188 188 189 189 190 190 191 192 192 192 193 193 - 194 194 195 195 196 197 197 198 198 199 199 200 200 0 0 255 - 255 184 177 171 165 159 153 147 141 134 128 116 110 104 98 92 85 79 73 67 - 61 49 42 36 30 24 18 12 6 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 8 25 38 51 63 76 89 - 97 114 140 152 165 178 195 203 216 229 242 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 250 238 221 212 195 187 170 161 144 131 - 123 106 97 80 72 55 42 29 17 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 - 2 3 3 4 5 6 7 8 9 9 10 11 12 12 13 15 16 16 17 18 - 19 19 20 21 22 23 24 25 25 26 27 28 28 29 30 32 32 33 34 35 - 35 36 37 38 38 40 41 41 42 43 44 44 45 0 0 255 - 255 184 177 171 165 159 153 147 141 134 128 116 110 104 98 92 85 79 73 67 - 61 49 42 36 30 24 18 12 6 0 0 14 28 38 53 63 77 86 100 109 - 118 132 154 163 177 186 200 209 223 232 241 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 242 225 216 199 191 174 165 152 - 135 127 110 102 84 76 59 46 34 21 12 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 5 - 8 11 14 17 20 23 26 29 32 35 38 41 44 47 50 53 59 59 59 62 - 62 65 65 68 68 70 70 73 73 76 76 79 79 82 82 85 85 88 88 91 - 91 94 94 97 97 100 103 106 109 112 115 118 121 124 127 133 136 139 140 142 - 144 146 148 150 151 155 157 159 161 162 164 166 168 170 172 175 177 179 181 183 - 185 186 188 190 192 196 197 199 201 203 205 207 208 210 212 216 218 220 221 223 - 225 227 229 231 232 236 238 240 242 243 245 247 249 255 0 255 diff --git a/model/aux/idl_twist/palettes/backtoblack.ct b/model/aux/idl_twist/palettes/backtoblack.ct deleted file mode 100755 index 3fa3a2d41..000000000 --- a/model/aux/idl_twist/palettes/backtoblack.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 4 4 13 13 22 22 31 31 40 40 50 50 58 58 64 69 69 72 - 72 77 77 80 80 83 83 84 84 87 87 86 86 87 85 85 84 84 84 - 84 79 79 77 77 71 71 68 68 60 55 55 46 46 43 43 36 36 25 - 25 16 16 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 8 21 21 29 29 42 42 51 51 63 63 - 67 67 76 76 89 97 97 110 110 119 119 131 131 140 140 153 153 157 157 - 165 165 178 187 187 199 199 208 208 221 221 229 229 242 242 246 246 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 226 226 198 170 170 141 141 113 113 85 - 85 56 56 28 28 0 0 255 255 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 4 4 16 25 25 38 38 42 42 51 51 63 63 72 - 72 84 84 93 106 106 114 114 127 127 131 131 140 140 152 152 161 161 174 - 174 182 195 195 203 203 216 216 220 220 229 229 242 242 250 250 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 242 - 242 233 233 221 221 212 212 199 199 191 191 178 178 174 174 165 153 153 144 - 144 131 131 123 123 110 110 102 102 90 90 79 68 68 56 56 45 45 34 - 34 22 22 11 11 0 0 0 0 - 0 3 3 10 10 19 19 28 28 38 38 48 48 59 59 68 77 77 81 - 81 91 91 100 100 109 109 118 118 127 127 136 136 145 154 154 159 159 168 - 168 177 177 186 186 195 195 204 204 214 223 223 232 232 236 236 245 245 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 238 238 - 225 225 216 216 203 203 199 199 191 191 178 178 170 170 157 148 148 135 135 - 127 127 114 114 110 110 102 102 89 89 80 67 67 59 59 46 46 38 38 - 25 25 21 21 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/bathy.ct b/model/aux/idl_twist/palettes/bathy.ct deleted file mode 100755 index fea3a7502..000000000 --- a/model/aux/idl_twist/palettes/bathy.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 25 25 25 25 25 16 16 16 16 16 4 4 4 4 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 8 25 25 33 33 42 51 51 63 63 67 89 89 93 93 101 119 - 119 131 144 144 157 157 169 182 182 199 199 208 221 221 233 233 246 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 8 8 8 21 21 21 21 21 25 25 25 38 38 38 38 38 46 46 - 46 46 51 51 51 51 51 63 63 63 63 63 72 72 72 76 76 76 76 - 76 89 89 89 97 97 97 97 97 106 106 106 114 114 114 114 114 127 127 - 127 127 131 131 131 131 131 140 140 140 140 140 152 152 152 157 157 157 157 - 157 165 165 165 178 178 178 178 178 182 182 182 182 195 195 195 195 195 203 - 203 203 208 208 208 208 208 220 220 220 229 229 233 233 246 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 250 250 - 238 238 221 212 212 195 195 187 170 170 170 170 161 153 153 144 144 131 127 - 127 119 119 119 106 106 102 102 89 80 80 76 76 63 63 63 55 55 51 - 38 38 29 29 21 12 12 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 246 - 238 220 220 212 212 199 195 195 187 187 174 157 157 148 148 144 131 131 123 - 123 114 97 97 89 89 80 67 67 63 63 55 38 38 25 25 16 12 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/bathy2.ct b/model/aux/idl_twist/palettes/bathy2.ct deleted file mode 100755 index 62dbf5492..000000000 --- a/model/aux/idl_twist/palettes/bathy2.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 8 25 25 33 33 42 51 51 63 63 67 89 89 93 93 101 119 - 119 131 144 144 157 157 169 182 182 199 199 208 221 221 233 233 246 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 91 92 93 94 95 96 97 98 100 101 102 103 104 105 106 107 109 110 - 111 112 113 114 115 116 118 119 120 121 122 123 124 125 127 128 129 130 131 - 132 133 134 136 137 138 139 140 141 142 143 145 146 147 148 149 150 151 152 - 154 155 156 157 158 159 160 162 163 164 165 166 167 168 169 171 172 173 174 - 175 176 177 178 180 181 182 183 184 185 186 187 189 190 191 192 193 194 196 - 198 199 201 203 204 206 208 209 211 213 214 216 218 219 221 223 224 226 228 - 229 231 233 234 236 238 239 241 243 244 246 248 249 251 253 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 250 250 - 238 238 221 212 212 195 195 187 170 170 170 170 161 153 153 144 144 131 127 - 127 119 119 119 106 106 102 102 89 80 80 76 76 63 63 63 55 55 51 - 38 38 29 29 21 12 12 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 246 - 238 220 220 212 212 199 195 195 187 187 174 157 157 148 148 144 131 131 123 - 123 114 97 97 89 89 80 67 67 63 63 55 38 38 25 25 16 12 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/bathy3.ct b/model/aux/idl_twist/palettes/bathy3.ct deleted file mode 100755 index 82ca3fc02..000000000 --- a/model/aux/idl_twist/palettes/bathy3.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 47 47 48 49 49 50 50 51 52 52 53 54 54 55 57 57 58 58 - 59 60 60 61 62 62 63 64 64 66 66 67 68 68 69 70 70 71 72 - 72 73 73 75 76 76 77 78 78 79 80 80 81 81 82 84 84 85 86 - 86 87 88 88 89 89 91 93 93 95 97 97 99 101 101 103 103 105 107 - 107 109 111 111 113 115 115 117 117 119 121 121 123 125 125 127 129 129 130 - 130 132 134 134 136 138 138 140 142 142 144 144 146 148 148 150 152 152 154 - 156 156 158 158 160 162 162 164 166 166 168 170 170 169 168 168 167 167 166 - 165 165 164 163 163 163 162 162 161 161 160 159 159 158 157 157 157 148 148 - 140 140 132 124 124 115 107 107 99 91 91 82 82 74 66 66 58 49 49 - 41 33 33 25 25 35 46 46 56 67 67 78 89 89 89 89 93 106 106 - 120 133 133 147 160 160 174 174 187 201 201 214 228 228 241 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 175 175 175 176 176 177 177 178 179 179 180 181 181 182 183 183 184 184 - 185 186 186 187 188 188 189 190 190 191 191 192 193 193 194 195 195 196 197 - 197 198 198 199 200 200 201 202 202 203 204 204 205 205 206 207 207 208 209 - 209 210 211 211 212 212 213 214 214 215 216 216 217 218 218 219 219 220 221 - 221 222 223 223 224 225 225 226 226 227 228 228 229 230 230 231 232 232 233 - 233 234 235 235 236 237 237 238 239 239 240 240 241 242 242 243 244 244 245 - 246 246 247 247 248 249 249 250 251 251 252 253 253 253 253 253 253 253 253 - 253 253 253 253 253 254 254 254 254 254 254 254 254 254 254 254 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 248 - 241 234 234 228 221 221 214 207 207 201 201 194 187 187 180 174 174 167 161 - 161 154 154 148 141 141 135 128 128 122 116 116 104 104 92 81 81 69 58 - 58 46 35 35 23 23 12 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 248 242 242 236 236 229 - 223 223 217 210 210 204 198 198 191 191 185 179 179 172 166 166 160 157 157 - 154 154 151 148 148 145 142 142 139 136 136 133 133 130 127 127 124 121 121 - 118 115 115 112 112 94 77 77 60 43 43 26 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 - 14 21 21 29 36 36 43 50 50 58 58 65 72 72 79 87 87 86 85 - 85 84 84 83 82 82 81 80 80 79 78 78 69 69 60 52 52 43 34 - 34 26 17 17 8 8 0 0 0 diff --git a/model/aux/idl_twist/palettes/bathy3white.ct b/model/aux/idl_twist/palettes/bathy3white.ct deleted file mode 100755 index ebf970b5b..000000000 --- a/model/aux/idl_twist/palettes/bathy3white.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 255 47 47 49 49 50 50 51 51 52 52 54 54 55 55 57 57 58 - 58 60 60 60 62 62 63 63 64 64 66 66 68 68 69 69 70 70 72 - 72 73 73 76 76 76 77 77 78 78 80 80 81 81 82 82 84 84 86 - 86 88 88 89 89 91 91 93 93 93 97 97 99 99 101 101 103 103 107 - 107 109 109 113 113 115 115 117 117 121 121 121 123 123 125 125 129 129 130 - 130 132 132 136 136 138 138 142 142 144 144 146 146 146 148 148 152 152 154 - 154 156 156 160 160 162 162 166 166 168 168 170 170 168 168 168 167 167 166 - 166 165 165 163 163 162 162 161 161 160 160 159 159 157 157 157 157 157 148 - 148 140 140 124 124 107 107 99 99 91 91 82 82 66 66 58 58 49 49 - 49 33 33 25 25 46 46 56 56 67 67 89 89 89 89 93 93 106 106 - 133 133 147 147 147 160 160 187 187 201 201 228 228 241 241 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 0 0 0 - 255 255 175 175 176 176 177 177 178 178 179 179 181 181 182 182 183 183 184 - 184 186 186 186 188 188 189 189 190 190 191 191 193 193 194 194 195 195 197 - 197 198 198 200 200 200 201 201 202 202 204 204 205 205 206 206 207 207 209 - 209 211 211 212 212 213 213 214 214 214 216 216 217 217 218 218 219 219 221 - 221 222 222 224 224 225 225 226 226 228 228 228 229 229 230 230 232 232 233 - 233 234 234 236 236 237 237 239 239 240 240 241 241 241 242 242 244 244 245 - 245 246 246 248 248 249 249 251 251 252 252 253 253 253 253 253 253 253 253 - 253 253 253 253 253 254 254 254 254 254 254 254 254 254 254 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 248 - 234 234 228 228 221 221 221 207 207 201 201 187 187 180 180 174 174 161 161 - 154 154 148 148 141 141 128 128 128 116 116 104 104 92 92 81 81 58 58 - 46 46 40 40 35 35 0 0 0 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 242 242 242 236 236 229 - 229 223 223 210 210 198 198 191 191 185 185 179 179 166 166 160 160 160 157 - 157 154 154 148 148 142 142 139 139 136 136 133 133 127 127 124 124 121 121 - 121 115 115 112 112 77 77 60 60 43 43 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 - 21 21 29 29 36 36 36 50 50 58 58 72 72 79 79 87 87 85 85 - 84 84 83 83 82 82 80 80 80 78 78 69 69 60 60 52 52 34 34 - 26 26 22 22 18 18 0 0 0 diff --git a/model/aux/idl_twist/palettes/bathy4.ct b/model/aux/idl_twist/palettes/bathy4.ct deleted file mode 100755 index 38390de46..000000000 --- a/model/aux/idl_twist/palettes/bathy4.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 14 14 47 49 49 49 50 50 51 52 53 53 54 55 55 57 58 58 - 59 60 60 60 62 62 62 64 64 64 66 67 67 68 69 69 70 71 71 - 72 73 73 75 76 76 76 78 78 78 80 80 80 81 82 82 84 85 85 - 86 87 87 88 89 89 91 93 93 93 97 97 97 101 101 101 103 105 105 - 107 109 109 111 113 113 115 117 117 119 121 121 121 125 125 125 129 129 129 - 130 132 132 134 136 136 138 140 140 142 144 144 144 148 148 148 152 152 152 - 156 156 156 158 160 160 162 164 164 166 168 168 170 169 168 168 167 167 167 - 165 165 165 163 163 163 162 162 162 161 160 160 159 158 158 157 157 148 148 - 140 140 140 124 124 124 107 107 107 91 91 91 82 74 74 66 58 49 49 - 41 33 33 25 25 25 46 46 46 67 67 67 89 89 89 89 93 106 106 - 120 133 133 147 160 160 174 174 174 201 201 201 228 228 228 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 144 144 175 176 176 176 177 177 178 179 180 180 181 182 182 183 184 184 - 185 186 186 186 188 188 188 190 190 190 191 192 192 193 194 194 195 196 196 - 197 198 198 199 200 200 200 202 202 202 204 204 204 205 206 206 207 208 208 - 209 210 210 211 212 212 213 214 214 214 216 216 216 218 218 218 219 220 220 - 221 222 222 223 224 224 225 226 226 227 228 228 228 230 230 230 232 232 232 - 233 234 234 235 236 236 237 238 238 239 240 240 240 242 242 242 244 244 244 - 246 246 246 247 248 248 249 250 250 251 252 252 253 253 253 253 253 253 253 - 253 253 253 253 253 253 254 254 254 254 254 254 254 254 254 254 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 248 - 241 234 234 228 221 221 214 207 207 201 201 201 187 187 187 174 174 174 161 - 161 154 154 148 141 141 135 128 128 122 116 116 104 104 104 81 81 81 58 - 58 35 35 35 23 23 255 0 0 - 0 230 230 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 248 242 242 236 236 236 - 223 223 223 210 210 210 198 198 198 191 185 185 179 172 172 166 160 157 157 - 154 154 154 148 148 148 142 142 142 136 136 136 133 130 130 127 124 121 121 - 118 115 115 112 112 112 77 77 77 43 43 43 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 - 14 21 21 29 36 36 43 50 50 58 58 58 72 72 72 87 87 87 85 - 85 84 84 83 82 82 81 80 80 79 78 78 69 69 69 52 52 52 34 - 34 17 17 17 8 8 255 0 0 diff --git a/model/aux/idl_twist/palettes/bathygif.ct b/model/aux/idl_twist/palettes/bathygif.ct deleted file mode 100755 index d6f5e2871..000000000 --- a/model/aux/idl_twist/palettes/bathygif.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 25 25 25 25 25 16 16 16 16 16 4 4 4 4 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 8 25 25 33 33 42 51 51 63 63 67 89 89 93 93 101 119 - 119 131 144 144 157 157 169 182 182 199 199 208 221 221 233 233 246 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 0 0 - 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 8 8 8 21 21 21 21 21 25 25 25 38 38 38 38 38 46 46 - 46 46 51 51 51 51 51 63 63 63 63 63 72 72 72 76 76 76 76 - 76 89 89 89 97 97 97 97 97 106 106 106 114 114 114 114 114 127 127 - 127 127 131 131 131 131 131 140 140 140 140 140 152 152 152 157 157 157 157 - 157 165 165 165 178 178 178 178 178 182 182 182 182 195 195 195 195 195 203 - 203 203 208 208 208 208 208 220 220 220 229 229 233 233 246 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 250 250 - 238 238 221 212 212 195 195 187 170 170 170 170 161 153 153 144 144 131 127 - 127 119 119 119 106 106 102 102 89 80 80 76 76 63 63 63 55 55 51 - 38 38 29 29 20 12 12 0 0 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 246 - 238 220 220 212 212 199 195 195 187 187 174 157 157 148 148 144 131 131 123 - 123 114 97 97 89 89 80 67 67 63 63 55 38 38 25 25 16 12 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/bwflipped.ct b/model/aux/idl_twist/palettes/bwflipped.ct deleted file mode 100755 index 3d96dfb9f..000000000 --- a/model/aux/idl_twist/palettes/bwflipped.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 255 251 251 250 248 248 246 245 245 243 243 242 240 240 238 238 237 - 235 235 233 232 232 230 230 229 227 227 225 224 224 222 222 220 219 219 217 - 217 216 214 214 212 211 211 209 209 207 206 206 204 204 203 201 201 199 198 - 198 196 196 194 193 193 191 190 190 188 188 186 185 185 183 183 181 180 180 - 178 177 177 175 175 173 172 172 170 170 168 167 167 165 164 164 162 162 160 - 159 159 157 157 155 154 154 152 151 151 149 149 147 146 146 144 142 142 141 - 141 139 138 138 136 136 134 133 133 131 129 129 128 128 125 123 123 121 121 - 120 118 118 116 115 115 113 113 112 110 110 108 108 107 105 105 103 102 102 - 100 100 99 97 97 95 94 94 92 92 90 89 89 87 87 86 84 84 82 - 81 81 79 79 77 76 76 74 74 73 71 71 69 68 68 66 66 64 63 - 63 61 60 60 58 58 56 55 55 53 53 51 50 50 48 47 47 45 45 - 43 42 42 40 40 38 37 37 35 34 34 32 32 30 29 29 27 27 25 - 24 24 22 21 21 19 19 17 16 16 14 12 12 11 11 9 8 8 6 - 6 4 3 3 1 0 0 255 255 - 0 255 255 251 251 250 248 248 246 245 245 243 243 242 240 240 238 238 237 - 235 235 233 232 232 230 230 229 227 227 225 224 224 222 222 220 219 219 217 - 217 216 214 214 212 211 211 209 209 207 206 206 204 204 203 201 201 199 198 - 198 196 196 194 193 193 191 190 190 188 188 186 185 185 183 183 181 180 180 - 178 177 177 175 175 173 172 172 170 170 168 167 167 165 164 164 162 162 160 - 159 159 157 157 155 154 154 152 151 151 149 149 147 146 146 144 142 142 141 - 141 139 138 138 136 136 134 133 133 131 129 129 128 128 125 123 123 121 121 - 120 118 118 116 115 115 113 113 112 110 110 108 108 107 105 105 103 102 102 - 100 100 99 97 97 95 94 94 92 92 90 89 89 87 87 86 84 84 82 - 81 81 79 79 77 76 76 74 74 73 71 71 69 68 68 66 66 64 63 - 63 61 60 60 58 58 56 55 55 53 53 51 50 50 48 47 47 45 45 - 43 42 42 40 40 38 37 37 35 34 34 32 32 30 29 29 27 27 25 - 24 24 22 21 21 19 19 17 16 16 14 12 12 11 11 9 8 8 6 - 6 4 3 3 1 0 0 255 255 - 0 255 255 251 251 250 248 248 246 245 245 243 243 242 240 240 238 238 237 - 235 235 233 232 232 230 230 229 227 227 225 224 224 222 222 220 219 219 217 - 217 216 214 214 212 211 211 209 209 207 206 206 204 204 203 201 201 199 198 - 198 196 196 194 193 193 191 190 190 188 188 186 185 185 183 183 181 180 180 - 178 177 177 175 175 173 172 172 170 170 168 167 167 165 164 164 162 162 160 - 159 159 157 157 155 154 154 152 151 151 149 149 147 146 146 144 142 142 141 - 141 139 138 138 136 136 134 133 133 131 129 129 128 128 125 123 123 121 121 - 120 118 118 116 115 115 113 113 112 110 110 108 108 107 105 105 103 102 102 - 100 100 99 97 97 95 94 94 92 92 90 89 89 87 87 86 84 84 82 - 81 81 79 79 77 76 76 74 74 73 71 71 69 68 68 66 66 64 63 - 63 61 60 60 58 58 56 55 55 53 53 51 50 50 48 47 47 45 45 - 43 42 42 40 40 38 37 37 35 34 34 32 32 30 29 29 27 27 25 - 24 24 22 21 21 19 19 17 16 16 14 12 12 11 11 9 8 8 6 - 6 4 3 3 1 0 0 255 255 diff --git a/model/aux/idl_twist/palettes/current_v0.ct b/model/aux/idl_twist/palettes/current_v0.ct deleted file mode 100644 index 8f1d9ec65..000000000 --- a/model/aux/idl_twist/palettes/current_v0.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 243 231 219 207 195 183 171 160 148 136 124 112 100 88 77 60 60 46 46 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 2 - 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 - 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 8 8 21 25 33 - 46 46 55 67 67 76 76 80 93 93 101 114 114 131 131 140 153 153 161 169 - 169 182 187 187 187 199 199 208 208 208 208 208 221 221 221 229 229 229 229 242 - 242 246 246 246 246 246 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 - 255 238 221 204 187 170 153 136 119 102 85 68 51 34 17 0 0 0 0 0 - 0 0 29 29 55 55 89 89 114 144 144 174 174 174 174 182 182 195 195 203 - 216 220 220 229 229 242 242 242 242 242 242 243 243 243 243 244 244 244 244 245 - 245 245 246 246 246 246 247 247 247 247 248 248 248 249 249 249 249 250 250 250 - 250 251 251 251 252 252 252 252 253 253 253 253 254 254 254 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 242 242 242 233 233 233 221 221 221 221 221 - 216 208 208 208 208 208 195 195 195 187 187 187 187 187 174 165 165 165 165 165 - 165 161 161 161 148 148 148 148 148 148 140 140 140 127 127 127 127 127 127 127 - 119 119 119 110 110 110 110 110 110 102 102 102 89 89 89 89 89 89 89 80 - 80 80 80 72 72 72 72 72 59 59 59 55 55 55 55 55 55 55 42 42 - 42 42 34 34 34 34 34 0 0 0 0 0 0 0 0 0 - 255 250 245 241 236 232 227 222 218 213 209 204 199 195 190 186 214 214 232 232 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 249 244 239 233 228 223 217 212 207 201 196 191 - 185 180 175 170 164 159 154 148 143 138 132 127 122 116 111 106 100 95 90 85 - 79 74 69 63 58 53 47 42 37 31 26 21 15 10 5 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/dg_hs.ct b/model/aux/idl_twist/palettes/dg_hs.ct deleted file mode 100755 index 660cec5a7..000000000 --- a/model/aux/idl_twist/palettes/dg_hs.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 118 107 102 97 92 87 82 82 77 77 71 66 61 56 51 46 41 35 - 30 30 25 20 15 10 10 5 5 0 0 6 8 8 10 12 14 14 16 - 20 20 25 25 27 29 31 31 33 35 35 37 39 42 42 40 38 37 37 - 34 34 34 32 30 29 29 27 27 26 26 24 22 22 21 21 19 19 18 - 16 16 16 14 14 14 13 12 12 10 9 9 8 40 40 57 90 90 106 - 139 139 156 156 169 176 176 189 189 195 209 209 215 215 228 228 228 235 235 - 241 241 248 248 248 248 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 172 - 255 37 48 53 59 64 69 75 75 80 80 85 91 96 101 107 112 118 123 - 128 128 134 139 144 150 150 155 155 161 161 164 168 168 172 176 180 180 185 - 193 193 202 202 208 215 221 221 228 235 235 241 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 251 251 251 247 247 244 244 244 244 240 240 - 240 240 237 237 233 233 233 233 233 230 230 226 226 226 226 222 222 219 219 - 215 215 215 212 212 212 212 208 208 208 208 208 205 205 201 201 201 201 201 - 198 198 187 187 187 187 187 176 176 165 165 165 165 165 154 154 154 143 143 - 143 143 143 132 132 132 122 122 122 122 122 111 111 111 100 100 100 89 89 - 89 89 89 78 78 78 67 67 67 65 65 65 65 65 65 65 65 65 65 - 65 66 66 66 66 66 66 66 66 66 66 66 66 67 67 67 67 67 67 - 67 67 67 50 33 16 0 255 70 - 255 212 215 217 219 221 223 225 225 227 227 228 230 232 234 236 238 240 241 - 243 243 245 247 249 251 251 253 253 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 244 238 238 - 227 227 227 222 216 211 211 205 205 200 200 194 189 189 183 183 178 178 173 - 155 155 155 121 121 121 103 86 86 69 51 51 34 44 44 50 60 60 66 - 76 76 82 82 78 77 77 73 73 72 68 68 67 67 63 63 63 62 62 - 60 60 58 58 58 58 57 57 58 58 58 59 59 60 60 60 60 62 62 - 62 62 63 63 64 64 64 64 64 66 66 67 67 67 67 68 68 70 70 - 71 71 71 72 72 72 72 74 74 74 74 74 75 75 76 76 76 76 76 - 78 78 81 81 81 81 81 84 84 87 87 87 87 87 90 90 90 93 93 - 93 93 93 96 96 96 99 99 99 99 99 102 102 102 105 105 105 108 108 - 108 108 108 111 111 111 114 114 114 109 109 106 106 106 100 100 100 98 98 - 98 95 95 95 89 89 89 87 87 87 84 84 84 78 78 78 76 76 76 - 73 73 73 54 36 18 0 255 4 diff --git a/model/aux/idl_twist/palettes/doppler2.ct b/model/aux/idl_twist/palettes/doppler2.ct deleted file mode 100755 index 05f08e60b..000000000 --- a/model/aux/idl_twist/palettes/doppler2.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 19 38 57 76 96 115 134 153 172 192 193 194 196 197 199 194 190 186 - 182 178 174 169 165 161 157 153 149 145 140 136 132 128 124 120 116 111 107 - 103 99 95 91 87 82 78 74 70 66 62 58 53 49 45 41 37 33 29 - 24 20 16 12 8 4 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 - 34 41 48 55 62 68 75 82 89 96 103 110 117 124 130 137 144 151 158 - 165 172 179 186 192 199 206 213 220 227 234 241 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 213 - 0 14 29 44 59 74 88 103 118 133 148 118 89 60 31 2 2 3 4 - 5 5 6 7 8 8 9 10 11 11 12 13 14 14 15 16 17 17 18 - 19 20 20 21 22 23 23 24 25 26 26 27 28 29 29 30 31 32 32 - 33 34 35 35 36 37 38 41 44 47 50 53 57 60 63 66 69 72 76 - 79 82 85 88 91 95 98 101 104 107 110 114 117 120 123 126 129 133 136 - 139 142 145 149 152 155 158 161 164 168 171 174 177 180 183 187 190 193 196 - 199 202 206 209 212 215 218 221 225 228 231 234 237 241 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 252 250 248 246 244 - 242 240 237 235 233 231 229 227 225 222 220 218 216 214 212 210 207 205 203 - 201 199 197 195 192 190 188 186 184 182 180 177 175 173 171 169 167 165 161 - 153 148 144 131 127 123 119 110 106 102 97 89 85 80 76 63 59 55 51 - 42 38 34 29 21 17 12 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 139 - 0 23 47 71 95 119 143 167 191 215 239 242 245 248 251 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 254 254 254 254 253 253 253 253 252 252 252 252 - 251 251 251 251 251 250 250 250 250 249 249 249 249 248 248 248 248 247 247 - 247 247 247 246 246 246 246 245 245 245 245 244 244 244 244 243 243 243 243 - 243 242 242 242 242 241 241 241 241 240 240 240 240 240 106 103 100 97 94 - 91 88 85 83 80 77 74 71 68 65 63 60 57 54 51 48 45 42 40 - 37 34 31 28 25 22 20 17 14 11 8 5 2 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 45 diff --git a/model/aux/idl_twist/palettes/doppler3.ct b/model/aux/idl_twist/palettes/doppler3.ct deleted file mode 100755 index c5ca6f8a5..000000000 --- a/model/aux/idl_twist/palettes/doppler3.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 127 130 133 137 140 144 147 150 154 157 161 164 168 171 174 178 181 185 - 188 192 192 193 194 194 196 196 197 197 199 199 194 194 190 190 186 186 182 - 182 178 178 174 174 169 169 165 161 161 157 157 153 153 149 149 145 145 140 - 140 136 136 132 132 128 128 124 124 120 120 116 111 111 107 107 103 103 99 - 99 95 95 91 91 87 87 82 82 78 78 74 74 70 70 66 62 53 45 - 37 24 16 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 - 34 41 48 55 62 68 75 82 89 96 103 110 117 124 130 137 144 151 158 - 165 172 179 186 192 199 206 213 220 227 234 241 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 213 - 0 127 128 129 130 131 132 133 134 135 136 138 139 140 141 142 143 144 145 - 146 148 148 118 89 89 60 60 31 31 2 2 2 2 3 3 4 4 5 - 5 5 5 6 6 7 7 8 8 8 9 9 10 10 11 11 11 11 12 - 12 13 13 14 14 14 14 15 15 16 16 17 17 17 18 18 19 19 20 - 20 20 20 21 21 22 22 23 23 23 23 24 24 25 25 26 26 28 29 - 31 33 35 36 38 47 53 60 66 76 82 88 95 104 110 117 123 133 139 - 145 152 161 168 174 180 190 196 202 209 218 225 231 241 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 252 250 248 246 244 - 242 240 237 235 233 231 229 227 225 222 220 218 216 214 212 210 207 205 203 - 201 199 197 195 192 190 188 186 184 182 180 177 175 173 171 169 167 165 161 - 153 148 144 131 127 123 119 110 106 102 97 89 85 80 76 63 59 55 51 - 42 38 34 29 21 17 12 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 139 - 0 127 132 138 144 150 156 162 168 174 180 185 191 197 203 209 215 221 227 - 233 239 239 242 245 245 248 248 251 251 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 254 253 253 252 252 251 251 250 250 249 249 248 247 247 - 247 246 245 245 244 244 243 243 242 242 241 241 240 240 106 103 100 97 94 - 91 88 85 83 80 77 74 71 68 65 63 60 57 54 51 48 45 42 40 - 37 34 31 28 25 22 20 17 14 11 8 5 2 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 45 diff --git a/model/aux/idl_twist/palettes/doppler4.ct b/model/aux/idl_twist/palettes/doppler4.ct deleted file mode 100755 index e34992fa8..000000000 --- a/model/aux/idl_twist/palettes/doppler4.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 140 141 142 144 145 147 148 150 151 153 154 155 157 158 160 161 163 164 - 166 167 169 170 171 173 174 176 177 179 180 182 183 185 185 188 188 192 192 - 193 194 196 197 199 199 194 190 186 182 182 178 174 169 165 161 157 153 153 - 149 145 140 136 132 132 128 124 120 116 111 107 103 99 99 95 91 87 82 - 78 74 74 70 62 53 37 16 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 - 34 41 48 55 62 68 75 82 89 96 103 110 117 124 130 137 144 151 158 - 165 172 179 186 192 199 206 213 220 227 234 241 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 213 - 0 140 140 140 140 140 140 140 141 141 141 141 141 141 142 142 142 142 142 - 142 143 143 143 143 143 143 144 144 144 144 144 144 145 145 146 146 148 148 - 118 89 60 31 2 2 2 3 4 5 5 5 6 7 8 8 9 10 10 - 11 11 12 13 14 14 14 15 16 17 17 18 19 20 20 20 21 22 23 - 23 24 24 25 26 28 31 35 38 38 47 47 53 60 60 66 76 76 82 - 88 88 95 104 104 110 117 117 123 133 133 139 139 145 152 152 161 168 168 - 174 180 180 190 196 196 202 209 209 218 225 225 231 241 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 252 250 248 246 244 - 242 240 237 235 233 231 229 227 225 222 220 218 216 214 212 210 207 205 203 - 201 199 197 195 192 190 188 186 184 182 180 177 175 173 171 169 167 165 161 - 153 148 144 131 127 123 119 110 106 102 97 89 85 80 76 63 59 55 51 - 42 38 34 29 21 17 12 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 139 - 0 140 142 145 148 151 154 156 159 162 165 168 170 173 176 179 182 184 187 - 190 193 196 198 201 204 207 210 212 215 218 221 224 227 227 233 233 239 239 - 242 245 248 251 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 254 254 253 253 253 252 252 252 251 - 251 251 250 250 250 249 249 249 248 247 247 247 247 247 246 246 245 245 245 - 244 244 244 243 243 243 242 242 242 241 241 241 240 240 106 103 100 97 94 - 91 88 85 83 80 77 74 71 68 65 63 60 57 54 51 48 45 42 40 - 37 34 31 28 25 22 20 17 14 11 8 5 2 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 45 diff --git a/model/aux/idl_twist/palettes/doppler4_inv.ct b/model/aux/idl_twist/palettes/doppler4_inv.ct deleted file mode 100755 index b4d01461c..000000000 --- a/model/aux/idl_twist/palettes/doppler4_inv.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 248 248 248 241 241 234 234 234 227 227 220 220 213 213 213 - 206 206 199 199 192 192 192 186 179 172 165 158 158 144 137 130 124 117 103 - 103 96 89 82 68 62 55 55 48 41 27 20 13 6 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 37 70 74 87 99 99 99 103 107 111 116 120 124 128 128 132 132 - 136 140 145 149 153 153 153 157 161 165 169 174 178 182 182 186 186 190 194 - 199 199 197 196 194 193 192 192 188 188 188 185 185 183 182 180 179 177 176 - 174 173 171 171 170 169 167 166 164 163 161 160 158 157 155 154 154 153 151 - 150 148 147 145 144 142 141 140 213 - 0 0 0 0 0 0 0 0 0 17 34 42 59 97 97 97 110 110 119 - 119 123 123 127 131 131 144 148 148 148 148 153 161 165 167 169 169 171 173 - 177 177 182 184 186 188 188 192 197 197 203 203 207 210 212 214 214 218 222 - 225 227 227 229 231 231 233 235 237 237 237 240 240 240 242 244 246 246 248 - 250 252 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 241 241 241 231 231 - 225 225 225 225 225 218 218 209 209 209 209 209 202 202 196 196 196 196 196 - 190 190 180 180 180 180 180 174 174 168 161 145 139 123 110 104 88 76 60 - 47 38 31 25 24 22 20 20 20 19 18 17 17 16 15 14 14 14 14 - 13 12 11 11 10 10 10 9 8 8 7 6 5 5 5 4 4 3 2 - 2 2 31 60 89 118 148 148 146 146 146 145 145 144 144 144 144 144 144 - 143 143 143 143 143 143 143 142 142 142 142 142 142 141 141 141 141 141 141 - 141 140 140 140 140 140 140 140 139 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 2 2 2 5 5 8 8 8 11 11 14 14 17 17 17 - 20 20 22 22 25 25 25 28 31 34 37 40 40 45 48 51 54 57 63 - 63 65 68 71 77 80 83 83 85 88 94 97 100 103 240 240 240 240 240 - 241 241 241 241 241 241 241 242 242 242 242 242 242 242 243 243 243 243 243 - 243 243 244 244 244 244 244 244 244 245 245 247 247 248 249 250 251 252 253 - 254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 251 248 245 242 239 239 233 233 233 227 227 224 221 218 215 212 210 - 207 204 201 201 198 196 193 190 187 184 182 179 176 173 170 168 168 165 162 - 159 156 154 151 148 145 142 140 45 diff --git a/model/aux/idl_twist/palettes/doppler5.ct b/model/aux/idl_twist/palettes/doppler5.ct deleted file mode 100755 index cbc184e65..000000000 --- a/model/aux/idl_twist/palettes/doppler5.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 141 142 144 145 146 148 149 150 152 153 154 156 157 158 160 161 162 164 - 165 166 168 169 170 172 173 174 176 177 178 180 181 182 184 185 186 188 189 - 190 192 193 194 196 197 199 199 194 190 186 186 182 182 178 174 169 165 161 - 157 153 153 153 149 145 140 136 132 132 128 128 124 120 116 111 107 103 99 - 99 99 87 74 70 37 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 48 - 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 179 - 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 234 - 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 128 - 0 140 140 140 140 141 141 141 141 141 142 142 142 142 142 143 143 143 143 - 143 144 144 144 144 144 145 145 145 145 145 146 146 146 146 146 147 147 147 - 147 148 118 89 60 31 2 2 2 3 4 4 5 5 5 6 7 8 8 - 9 10 10 10 11 11 12 13 14 14 14 14 15 16 17 17 18 19 20 - 20 20 22 24 25 31 38 47 60 76 88 104 110 123 139 145 161 168 174 - 174 180 180 180 180 180 190 190 196 196 196 196 196 202 202 209 209 209 209 - 209 218 218 225 225 225 225 225 231 231 241 241 241 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 229 - 227 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 128 - 0 142 145 147 150 152 155 157 160 162 165 167 170 173 175 178 180 183 185 - 188 190 193 195 198 200 203 206 208 211 213 216 218 221 223 226 228 231 233 - 236 239 242 245 248 251 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 254 253 252 251 250 249 248 247 247 245 245 244 - 244 244 244 244 244 244 243 243 243 243 243 243 243 242 242 242 242 242 242 - 242 241 241 241 241 241 241 241 240 240 240 240 240 103 100 97 94 88 85 - 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 31 - 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 8 - 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 128 diff --git a/model/aux/idl_twist/palettes/doppler5_inv.ct b/model/aux/idl_twist/palettes/doppler5_inv.ct deleted file mode 100755 index 4e44070a6..000000000 --- a/model/aux/idl_twist/palettes/doppler5_inv.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 - 248 248 241 241 241 234 234 234 234 227 227 227 220 220 220 213 213 213 213 - 206 206 199 199 192 192 192 186 179 172 165 158 158 144 137 130 124 117 103 - 103 96 89 82 68 62 55 55 48 41 27 20 13 6 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 37 70 74 87 99 99 99 103 107 111 116 120 124 128 128 132 132 - 136 140 145 149 153 153 153 157 161 165 169 174 178 182 182 186 186 190 194 - 199 199 197 196 194 193 192 190 189 188 186 185 184 182 181 180 178 177 176 - 174 173 172 170 169 168 166 165 164 162 161 160 158 157 156 154 153 152 150 - 149 148 146 145 144 142 141 140 128 - 0 0 0 0 0 0 0 0 0 17 34 42 59 97 97 97 110 110 119 - 119 123 123 127 131 131 144 148 148 148 148 153 161 161 165 167 167 169 169 - 169 171 173 173 177 177 177 182 184 186 186 188 188 192 197 197 203 203 207 - 210 212 214 214 218 222 225 227 229 231 235 237 240 240 244 246 250 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 241 241 241 231 231 - 225 225 225 225 225 218 218 209 209 209 209 209 202 202 196 196 196 196 196 - 190 190 180 180 180 180 180 174 174 168 161 145 139 123 110 104 88 76 60 - 47 38 31 25 24 22 20 20 20 19 18 17 17 16 15 14 14 14 14 - 13 12 11 11 10 10 10 9 8 8 7 6 5 5 5 4 4 3 2 - 2 2 31 60 89 118 148 147 147 147 147 146 146 146 146 146 145 145 145 - 145 145 144 144 144 144 144 143 143 143 143 143 142 142 142 142 142 141 141 - 141 141 141 140 140 140 140 140 128 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 - 2 2 5 5 5 8 8 8 8 11 11 11 14 14 14 17 17 17 17 - 20 20 22 22 25 25 25 28 31 34 37 40 40 45 48 51 54 57 63 - 63 65 68 71 77 80 83 83 85 88 94 97 100 103 240 240 240 240 240 - 241 241 241 241 241 241 241 242 242 242 242 242 242 242 243 243 243 243 243 - 243 243 244 244 244 244 244 244 244 245 245 247 247 248 249 250 251 252 253 - 254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 251 248 245 242 239 236 233 231 228 226 223 221 218 216 213 211 208 - 206 203 200 198 195 193 190 188 185 183 180 178 175 173 170 167 165 162 160 - 157 155 152 150 147 145 142 140 128 diff --git a/model/aux/idl_twist/palettes/doppler5w.ct b/model/aux/idl_twist/palettes/doppler5w.ct deleted file mode 100755 index f72a09be0..000000000 --- a/model/aux/idl_twist/palettes/doppler5w.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 142 144 145 146 148 149 150 152 153 154 156 157 158 160 161 162 164 - 165 166 168 169 170 172 173 174 176 177 178 180 181 182 184 185 186 188 189 - 190 192 193 194 196 197 199 199 194 190 186 186 182 182 178 174 169 165 161 - 157 153 153 153 149 145 140 136 132 132 128 128 124 120 116 111 107 103 99 - 99 99 87 74 70 37 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 48 - 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 179 - 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 234 - 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 255 140 140 140 141 141 141 141 141 142 142 142 142 142 143 143 143 143 - 143 144 144 144 144 144 145 145 145 145 145 146 146 146 146 146 147 147 147 - 147 148 118 89 60 31 2 2 2 3 4 4 5 5 5 6 7 8 8 - 9 10 10 10 11 11 12 13 14 14 14 14 15 16 17 17 18 19 20 - 20 20 22 24 25 31 38 47 60 76 88 104 110 123 139 145 161 168 174 - 174 180 180 180 180 180 190 190 196 196 196 196 196 202 202 209 209 209 209 - 209 218 218 225 225 225 225 225 231 231 241 241 241 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 229 - 227 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 0 - 0 255 145 147 150 152 155 157 160 162 165 167 170 173 175 178 180 183 185 - 188 190 193 195 198 200 203 206 208 211 213 216 218 221 223 226 228 231 233 - 236 239 242 245 248 251 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 254 253 252 251 250 249 248 247 247 245 245 244 - 244 244 244 244 244 244 243 243 243 243 243 243 243 242 242 242 242 242 242 - 242 241 241 241 241 241 241 241 240 240 240 240 240 103 100 97 94 88 85 - 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 31 - 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 8 - 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/doppler6.ct b/model/aux/idl_twist/palettes/doppler6.ct deleted file mode 100755 index d83ba716d..000000000 --- a/model/aux/idl_twist/palettes/doppler6.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 200 190 183 177 170 164 158 161 163 165 167 170 172 174 176 179 181 183 - 185 188 190 192 194 197 199 199 199 194 190 186 186 186 182 182 182 178 174 - 169 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 128 128 - 128 124 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 48 - 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 179 - 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 234 - 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 200 190 176 163 150 137 124 119 113 108 102 97 91 86 80 75 69 64 - 58 53 47 42 36 31 2 2 2 2 3 4 4 4 5 5 5 5 6 - 7 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 14 14 - 14 15 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 76 88 - 104 110 123 139 145 161 168 174 174 180 180 180 180 180 190 190 190 196 196 - 196 196 196 196 196 202 202 202 209 209 209 209 209 209 209 218 218 218 225 - 225 225 225 225 225 225 231 231 231 241 241 241 241 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 229 - 227 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 0 - 0 200 190 187 184 181 178 175 179 184 188 193 197 202 206 210 215 219 224 - 228 233 237 242 246 251 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 252 251 - 250 249 248 247 247 245 245 244 244 244 244 244 244 244 243 243 243 243 243 - 243 243 243 243 243 242 242 242 242 242 242 242 242 242 242 241 241 241 241 - 241 241 241 241 241 241 240 240 240 240 240 240 240 103 100 97 94 88 85 - 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 31 - 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 8 - 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/doppler6w.ct b/model/aux/idl_twist/palettes/doppler6w.ct deleted file mode 100755 index 494882afe..000000000 --- a/model/aux/idl_twist/palettes/doppler6w.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 190 183 177 170 164 158 161 163 165 167 170 172 174 176 179 181 183 - 185 188 190 192 194 197 199 199 199 194 190 186 186 186 182 182 182 178 174 - 169 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 128 128 - 128 124 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 48 - 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 179 - 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 234 - 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 255 190 176 163 150 137 124 119 113 108 102 97 91 86 80 75 69 64 - 58 53 47 42 36 31 2 2 2 2 3 4 4 4 5 5 5 5 6 - 7 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 14 14 - 14 15 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 76 88 - 104 110 123 139 145 161 168 174 174 180 180 180 180 180 190 190 190 196 196 - 196 196 196 196 196 202 202 202 209 209 209 209 209 209 209 218 218 218 225 - 225 225 225 225 225 225 231 231 231 241 241 241 241 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 229 - 227 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 0 - 0 255 190 187 184 181 178 175 179 184 188 193 197 202 206 210 215 219 224 - 228 233 237 242 246 251 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 252 251 - 250 249 248 247 247 245 245 244 244 244 244 244 244 244 243 243 243 243 243 - 243 243 243 243 243 242 242 242 242 242 242 242 242 242 242 241 241 241 241 - 241 241 241 241 241 241 240 240 240 240 240 240 240 103 100 97 94 88 85 - 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 31 - 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 8 - 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/doppler7.ct b/model/aux/idl_twist/palettes/doppler7.ct deleted file mode 100755 index 8a89158ef..000000000 --- a/model/aux/idl_twist/palettes/doppler7.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 200 190 190 190 190 190 183 183 183 183 177 177 177 177 170 170 170 170 - 164 164 164 164 164 158 158 158 158 161 161 161 161 163 163 163 163 165 165 - 165 165 167 170 172 176 179 183 185 188 192 194 199 199 199 190 186 186 182 - 182 178 174 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 - 128 128 128 124 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 - 48 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 - 179 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 - 234 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 200 190 190 190 190 190 176 176 176 176 163 163 163 163 150 150 150 150 - 137 137 137 137 137 124 124 124 124 119 119 119 119 113 113 113 113 108 108 - 108 108 102 97 91 80 75 64 58 53 42 36 2 2 2 3 4 4 5 - 5 5 6 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 - 14 14 14 15 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 - 76 88 104 110 123 139 145 168 174 180 180 180 190 190 196 196 196 202 202 - 209 209 209 209 218 225 225 225 225 231 231 241 241 241 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 - 229 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 0 - 0 200 190 190 190 190 190 187 187 187 187 184 184 184 184 181 181 181 181 - 178 178 178 178 178 175 175 175 175 179 179 179 179 184 184 184 184 188 188 - 188 188 193 197 202 210 215 224 228 233 242 246 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 - 252 251 250 249 248 247 247 245 244 244 244 244 243 243 243 243 243 242 242 - 242 242 242 242 241 241 241 241 241 240 240 240 240 240 103 100 97 94 88 - 85 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 - 31 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 - 8 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/doppler7bw.ct b/model/aux/idl_twist/palettes/doppler7bw.ct deleted file mode 100755 index d0bdd80a9..000000000 --- a/model/aux/idl_twist/palettes/doppler7bw.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 200 190 190 190 190 190 183 183 183 183 177 177 177 177 170 170 170 170 - 164 164 164 164 164 158 158 158 158 161 161 161 161 163 163 163 163 165 165 - 165 165 167 170 172 176 179 183 185 188 192 194 199 199 199 190 186 186 182 - 182 178 174 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 - 128 128 128 124 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 - 48 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 - 179 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 - 234 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 0 - 255 200 190 190 190 190 190 176 176 176 176 163 163 163 163 150 150 150 150 - 137 137 137 137 137 124 124 124 124 119 119 119 119 113 113 113 113 108 108 - 108 108 102 97 91 80 75 64 58 53 42 36 2 2 2 3 4 4 5 - 5 5 6 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 - 14 14 14 15 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 - 76 88 104 110 123 139 145 168 174 180 180 180 190 190 196 196 196 202 202 - 209 209 209 209 218 225 225 225 225 231 231 241 241 241 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 - 229 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 0 - 255 200 190 190 190 190 190 187 187 187 187 184 184 184 184 181 181 181 181 - 178 178 178 178 178 175 175 175 175 179 179 179 179 184 184 184 184 188 188 - 188 188 193 197 202 210 215 224 228 233 242 246 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 - 252 251 250 249 248 247 247 245 244 244 244 244 243 243 243 243 243 242 242 - 242 242 242 242 241 241 241 241 241 240 240 240 240 240 103 100 97 94 88 - 85 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 - 31 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 - 8 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/doppler7bw2.ct b/model/aux/idl_twist/palettes/doppler7bw2.ct deleted file mode 100755 index 7fd45d5e5..000000000 --- a/model/aux/idl_twist/palettes/doppler7bw2.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 200 206 190 190 190 190 183 183 183 183 177 177 177 177 170 170 170 170 - 164 164 164 164 164 158 158 158 158 161 161 161 161 163 163 163 163 165 165 - 165 165 167 170 172 176 179 183 185 188 192 194 199 199 199 190 186 186 182 - 182 178 174 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 - 128 128 128 124 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 27 41 - 48 55 55 62 68 82 89 96 103 103 117 124 130 137 144 158 158 165 172 - 179 186 192 192 192 199 199 206 206 213 213 213 213 220 220 220 227 227 227 - 234 234 234 234 241 241 241 248 248 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 0 - 255 200 147 190 190 190 190 176 176 176 176 163 163 163 163 150 150 150 150 - 137 137 137 137 137 124 124 124 124 119 119 119 119 113 113 113 113 108 108 - 108 108 102 97 91 80 75 64 58 53 42 36 2 2 2 3 4 4 5 - 5 5 6 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 - 14 14 14 15 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 - 76 88 104 110 123 139 145 168 174 180 180 180 190 190 196 196 196 202 202 - 209 209 209 209 218 225 225 225 225 231 231 241 241 241 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 250 246 244 240 240 237 235 231 - 229 225 222 218 214 214 212 210 207 203 203 197 197 192 188 188 186 186 184 - 182 177 177 177 173 173 171 169 169 169 167 167 165 161 161 153 148 148 148 - 148 144 131 131 127 123 123 119 119 110 110 97 97 97 59 42 34 17 0 - 0 0 0 0 0 0 0 0 0 - 255 200 106 190 190 190 190 187 187 187 187 184 184 184 184 181 181 181 181 - 178 178 178 178 178 175 175 175 175 179 179 179 179 184 184 184 184 188 188 - 188 188 193 197 202 210 215 224 228 233 242 246 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 - 252 251 250 249 248 247 247 245 244 244 244 244 243 243 243 243 243 242 242 - 242 242 242 242 241 241 241 241 241 240 240 240 240 240 103 100 97 94 88 - 85 83 83 80 77 71 68 65 63 63 57 54 51 48 45 40 40 37 34 - 31 28 25 25 25 22 22 20 20 17 17 17 17 14 14 14 11 11 11 - 8 8 8 8 5 5 5 2 2 2 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/doppler_modified_land.ct b/model/aux/idl_twist/palettes/doppler_modified_land.ct deleted file mode 100755 index 91d5c657c..000000000 --- a/model/aux/idl_twist/palettes/doppler_modified_land.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 224 220 216 212 208 204 200 197 193 189 185 181 177 173 170 169 168 168 - 167 167 166 166 165 164 164 163 163 162 162 161 161 163 163 163 163 165 165 - 165 165 167 170 172 176 179 183 185 188 192 193 195 197 199 194 189 185 180 - 175 171 166 161 157 152 148 143 138 134 129 124 120 115 111 106 101 97 92 - 87 83 78 74 69 64 60 55 50 46 41 37 32 27 23 18 13 9 4 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 13 20 28 35 - 43 50 57 65 72 80 87 94 102 109 117 120 124 128 132 136 140 144 148 - 151 155 159 163 167 171 175 179 182 186 190 194 198 202 206 210 213 217 221 - 225 229 233 237 241 241 241 241 242 242 243 243 244 244 245 245 245 246 246 - 247 247 248 248 249 249 250 250 250 251 251 252 252 253 253 254 254 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 0 114 0 - 255 224 218 213 208 202 197 192 187 181 176 171 165 160 155 150 148 146 144 - 142 140 138 136 134 132 130 128 126 124 122 120 119 113 113 113 113 108 108 - 108 108 102 97 91 80 75 64 58 53 42 32 22 12 2 3 5 7 8 - 10 12 14 15 17 19 20 22 24 26 27 29 31 32 34 36 38 39 41 - 43 45 46 48 50 51 53 55 57 58 60 62 63 65 67 69 70 72 74 - 76 88 92 97 102 107 112 117 122 127 132 137 142 147 152 157 162 166 171 - 176 181 186 191 196 201 206 211 216 221 226 231 236 241 232 233 235 236 238 - 239 241 242 244 245 247 248 250 251 253 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 252 250 248 246 243 241 239 237 234 232 230 228 226 - 223 221 219 217 214 212 210 208 206 203 201 199 197 194 192 190 188 186 184 - 181 179 176 174 171 169 167 164 162 159 157 155 152 150 147 145 143 140 138 - 135 133 131 131 127 123 123 119 119 110 110 97 89 82 74 67 59 52 44 - 37 29 22 14 7 0 0 197 0 - 255 224 220 217 214 211 208 205 202 199 196 193 190 187 184 181 180 180 180 - 180 180 180 180 180 179 179 179 179 179 179 179 179 184 184 184 184 188 188 - 188 188 193 197 202 210 215 224 228 233 242 245 248 251 255 254 254 254 254 - 254 254 254 254 254 254 254 254 254 254 253 253 253 253 253 253 253 253 253 - 253 253 253 253 253 252 252 252 252 252 252 252 252 252 252 252 252 252 252 - 252 251 250 250 249 249 249 248 248 248 247 247 247 246 246 246 245 245 244 - 244 244 243 243 243 242 242 242 241 241 241 240 240 240 103 99 96 93 90 - 87 84 81 78 75 72 69 66 63 60 57 55 53 52 50 48 47 45 44 - 42 40 39 37 35 34 32 31 29 27 26 24 22 21 19 18 16 14 13 - 11 9 8 6 5 5 4 4 4 4 4 4 3 3 3 3 3 3 2 - 2 2 2 2 2 1 1 1 1 1 1 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 255 110 0 diff --git a/model/aux/idl_twist/palettes/doppler_modified_land_2.ct b/model/aux/idl_twist/palettes/doppler_modified_land_2.ct deleted file mode 100755 index ae0f4eb87..000000000 --- a/model/aux/idl_twist/palettes/doppler_modified_land_2.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 224 220 216 212 208 204 200 197 193 189 185 181 177 173 170 169 168 168 167 - 167 166 166 165 164 164 163 163 162 162 161 161 163 163 163 163 165 165 165 165 - 167 170 172 176 179 183 185 188 192 193 195 197 199 194 189 185 180 175 171 166 - 161 157 152 148 143 138 134 129 124 120 115 111 106 101 97 92 87 83 78 74 - 69 64 60 55 50 46 41 37 32 27 23 18 13 9 4 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 6 13 20 28 35 43 50 57 65 72 80 87 - 94 102 109 117 120 124 128 132 136 140 144 148 151 155 159 163 167 171 175 179 - 182 186 190 194 198 202 206 210 213 217 221 225 229 233 237 241 241 241 241 242 - 242 243 243 244 244 245 245 245 246 246 247 247 248 248 249 249 250 250 250 251 - 251 252 252 253 253 254 254 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 250 246 242 238 233 229 225 221 216 212 208 204 200 0 114 0 - 255 224 218 213 208 202 197 192 187 181 176 171 165 160 155 150 148 146 144 142 - 140 138 136 134 132 130 128 126 124 122 120 119 113 113 113 113 108 108 108 108 - 102 97 91 80 75 64 58 53 42 32 22 12 2 3 5 7 8 10 12 14 - 15 17 19 20 22 24 26 27 29 31 32 34 36 38 39 41 43 45 46 48 - 50 51 53 55 57 58 60 62 63 65 67 69 70 72 74 76 88 92 97 102 - 107 112 117 122 127 132 137 142 147 152 157 162 166 171 176 181 186 191 196 201 - 206 211 216 221 226 231 236 241 232 233 235 236 238 239 241 242 244 245 247 248 - 250 251 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 252 250 248 - 246 243 241 239 237 234 232 230 228 226 223 221 219 217 214 212 210 208 206 203 - 201 199 197 194 192 190 188 186 184 181 179 176 174 171 169 167 164 162 159 157 - 155 152 150 147 139 132 124 117 109 102 95 84 73 63 52 42 31 21 10 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 197 0 - 255 224 220 217 214 211 208 205 202 199 196 193 190 187 184 181 180 180 180 180 - 180 180 180 180 179 179 179 179 179 179 179 179 184 184 184 184 188 188 188 188 - 193 197 202 210 215 224 228 233 242 245 248 251 255 254 254 254 254 254 254 254 - 254 254 254 254 254 254 254 253 253 253 253 253 253 253 253 253 253 253 253 253 - 253 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 251 250 250 249 - 249 249 248 248 248 247 247 247 246 246 246 245 245 244 244 244 243 243 243 242 - 242 242 241 241 241 240 240 240 103 99 96 93 90 87 84 81 78 75 72 69 - 66 63 60 57 55 53 52 50 48 47 45 44 42 40 39 37 35 34 32 31 - 29 27 26 24 22 21 19 18 16 14 13 11 9 8 6 5 5 4 4 4 - 4 4 4 3 3 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 - 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 255 110 0 diff --git a/model/aux/idl_twist/palettes/doppler_modified_land_2_eps.ct b/model/aux/idl_twist/palettes/doppler_modified_land_2_eps.ct deleted file mode 100644 index ee3e5f744..000000000 --- a/model/aux/idl_twist/palettes/doppler_modified_land_2_eps.ct +++ /dev/null @@ -1,39 +0,0 @@ - 0 224 220 216 212 208 204 200 197 193 189 185 181 177 173 170 169 168 168 167 - 167 166 166 165 164 164 163 163 162 162 161 161 163 163 163 163 165 165 165 165 - 167 170 172 176 179 183 185 188 192 193 195 197 199 194 189 185 180 175 171 166 - 161 157 152 148 143 138 134 129 124 120 115 111 106 101 97 92 87 83 78 74 - 69 64 60 55 50 46 41 37 32 27 23 18 13 9 4 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 6 13 20 28 35 43 50 57 65 72 80 87 - 94 102 109 117 120 124 128 132 136 140 144 148 151 155 159 163 167 171 175 179 - 182 186 190 194 198 202 206 210 213 217 221 225 229 233 237 241 241 241 241 242 - 242 243 243 244 244 245 245 245 246 246 247 247 248 248 249 249 250 250 250 251 - 251 252 252 253 253 254 254 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 250 246 242 238 233 229 225 221 216 212 208 204 200 153 0 255 - 0 224 218 213 208 202 197 192 187 181 176 171 165 160 155 150 148 146 144 142 - 140 138 136 134 132 130 128 126 124 122 120 119 113 113 113 113 108 108 108 108 - 102 97 91 80 75 64 58 53 42 32 22 12 2 3 5 7 8 10 12 14 - 15 17 19 20 22 24 26 27 29 31 32 34 36 38 39 41 43 45 46 48 - 50 51 53 55 57 58 60 62 63 65 67 69 70 72 74 76 88 92 97 102 - 107 112 117 122 127 132 137 142 147 152 157 162 166 171 176 181 186 191 196 201 - 206 211 216 221 226 231 236 241 232 233 235 236 238 239 241 242 244 245 247 248 - 250 251 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 252 250 248 - 246 243 241 239 237 234 232 230 228 226 223 221 219 217 214 212 210 208 206 203 - 201 199 197 194 192 190 188 186 184 181 179 176 174 171 169 167 164 162 159 157 - 155 152 150 147 139 132 124 117 109 102 95 84 73 63 52 42 31 21 10 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 70 255 - 0 224 220 217 214 211 208 205 202 199 196 193 190 187 184 181 180 180 180 180 - 180 180 180 180 179 179 179 179 179 179 179 179 184 184 184 184 188 188 188 188 - 193 197 202 210 215 224 228 233 242 245 248 251 255 254 254 254 254 254 254 254 - 254 254 254 254 254 254 254 253 253 253 253 253 253 253 253 253 253 253 253 253 - 253 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 251 250 250 249 - 249 249 248 248 248 247 247 247 246 246 246 245 245 244 244 244 243 243 243 242 - 242 242 241 241 241 240 240 240 103 99 96 93 90 87 84 81 78 75 72 69 - 66 63 60 57 55 53 52 50 48 47 45 44 42 40 39 37 35 34 32 31 - 29 27 26 24 22 21 19 18 16 14 13 11 9 8 6 5 5 4 4 4 - 4 4 4 3 3 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 - 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 diff --git a/model/aux/idl_twist/palettes/e.ct b/model/aux/idl_twist/palettes/e.ct deleted file mode 100755 index 6192f4fb7..000000000 --- a/model/aux/idl_twist/palettes/e.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 255 223 223 199 199 174 174 150 125 125 101 101 77 77 60 60 46 - 46 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 - 8 8 21 21 25 25 25 33 33 46 46 46 46 55 67 67 67 67 76 - 76 76 76 80 80 93 93 93 101 101 114 114 114 114 123 131 131 131 131 - 140 140 153 153 153 153 161 169 169 169 169 182 182 187 187 187 199 199 208 - 208 208 208 221 221 229 229 229 242 242 246 246 246 246 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 255 255 188 188 157 157 125 125 94 62 62 31 31 0 0 0 0 0 - 0 0 0 0 29 29 55 55 89 89 114 144 144 174 174 174 174 182 182 - 195 195 203 216 216 220 220 229 229 242 242 242 250 250 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 242 242 242 - 233 233 221 221 221 221 216 208 208 208 208 195 195 187 187 187 187 174 165 - 165 165 165 161 161 148 148 148 140 140 127 127 127 127 119 119 110 110 110 - 102 102 89 89 89 89 80 80 72 72 72 59 59 55 55 55 55 42 42 - 34 34 34 0 0 0 0 0 0 - 0 255 255 245 245 235 235 225 225 215 205 205 195 195 186 186 214 214 232 - 232 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 246 242 242 233 - 233 220 220 212 199 199 199 199 191 191 187 187 174 165 165 152 152 144 144 - 135 135 135 127 127 114 114 106 106 97 97 84 84 80 67 67 59 59 59 - 59 46 46 46 38 38 25 25 25 25 21 21 12 12 12 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/fe.ct b/model/aux/idl_twist/palettes/fe.ct deleted file mode 100755 index 9a75ae86c..000000000 --- a/model/aux/idl_twist/palettes/fe.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 9 18 27 36 45 54 61 69 74 79 82 85 86 88 87 85 84 83 - 78 76 70 66 55 46 40 33 21 12 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 12 25 - 29 42 46 51 63 67 76 80 93 97 101 114 119 131 135 144 153 157 165 - 169 182 187 199 199 203 208 212 221 221 225 229 233 242 242 246 250 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 16 21 25 38 42 51 55 63 - 72 76 89 93 97 110 114 127 131 135 144 152 161 165 174 182 187 199 203 - 208 220 225 233 242 246 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 250 - 250 242 238 233 229 229 221 216 212 208 208 199 195 191 187 187 178 174 170 - 165 165 161 153 148 144 144 144 144 140 140 140 140 131 131 131 127 127 127 - 127 123 123 123 123 119 119 119 110 110 110 110 106 106 106 106 102 102 102 - 97 97 97 97 89 89 89 85 85 85 85 80 80 80 80 76 76 76 72 - 72 72 72 63 63 63 63 59 59 59 55 55 55 55 51 51 51 42 42 - 42 42 38 38 38 38 34 34 34 29 29 29 29 21 21 21 21 17 17 - 17 12 12 12 12 8 8 8 0 - 0 7 14 23 32 43 53 63 77 86 95 104 113 122 132 145 154 163 173 - 182 191 200 209 223 232 241 250 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 246 238 233 220 212 199 195 187 174 165 152 148 - 135 127 114 106 102 89 80 67 59 55 42 34 21 12 8 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/onr2000.ct b/model/aux/idl_twist/palettes/onr2000.ct deleted file mode 100755 index 04d9775cc..000000000 --- a/model/aux/idl_twist/palettes/onr2000.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 14 14 47 47 49 49 50 50 51 51 53 53 54 54 55 55 58 58 - 59 60 60 60 60 62 62 64 64 64 64 67 67 68 68 69 69 71 72 - 72 73 73 75 75 76 76 78 78 78 78 80 80 81 81 82 82 85 86 - 86 87 87 88 88 89 89 93 93 93 93 97 97 101 101 105 105 107 109 - 109 113 113 117 117 119 119 121 121 125 125 129 129 130 130 132 136 136 140 - 140 142 142 144 144 148 148 152 152 156 156 156 156 160 160 164 166 166 168 - 168 168 168 167 167 165 165 165 165 163 163 162 162 161 158 158 158 158 157 - 157 148 148 140 140 140 140 124 124 124 124 107 107 91 91 91 74 74 74 - 74 66 66 49 49 41 41 33 33 25 25 25 25 46 67 67 67 67 89 - 89 89 89 89 89 106 106 120 120 133 133 160 174 174 174 174 201 201 201 - 201 228 228 228 228 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 123 123 255 255 - 0 144 144 175 175 176 176 177 177 178 178 180 180 181 181 182 182 184 184 - 185 186 186 186 186 188 188 190 190 190 190 192 192 193 193 194 194 196 197 - 197 198 198 199 199 200 200 202 202 202 202 204 204 205 205 206 206 208 209 - 209 210 210 211 211 212 212 214 214 214 214 216 216 218 218 220 220 221 222 - 222 224 224 226 226 227 227 228 228 230 230 232 232 233 233 234 236 236 238 - 238 239 239 240 240 242 242 244 244 246 246 246 246 248 248 250 251 251 252 - 252 253 253 253 253 253 253 253 253 253 253 254 254 254 254 254 254 254 254 - 254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 248 248 241 241 234 221 221 214 214 207 207 201 - 201 201 201 187 187 187 187 174 174 174 174 161 154 154 141 141 135 135 128 - 128 122 122 116 116 104 104 83 83 83 62 62 62 62 41 41 20 20 20 - 20 0 0 255 255 0 0 0 0 - 0 230 230 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 242 242 236 236 223 223 223 223 210 210 198 198 191 172 172 172 172 166 - 166 157 157 154 154 154 154 148 148 148 148 142 142 136 136 136 130 130 130 - 130 127 127 121 121 118 118 115 115 112 112 112 112 77 43 43 43 43 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 7 7 14 14 21 36 36 43 43 50 50 58 - 58 58 58 72 72 72 72 87 87 87 87 85 84 84 82 82 81 81 80 - 80 79 79 78 78 69 69 55 55 55 41 41 41 41 27 27 13 13 13 - 13 0 0 255 255 112 112 0 0 diff --git a/model/aux/idl_twist/palettes/pastels.ct b/model/aux/idl_twist/palettes/pastels.ct deleted file mode 100755 index 2761e2620..000000000 --- a/model/aux/idl_twist/palettes/pastels.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 154 154 148 148 143 143 138 138 133 133 128 128 123 123 118 118 112 112 - 107 107 102 102 97 97 92 87 87 82 82 77 77 71 71 66 66 61 61 - 56 56 51 51 46 46 41 41 35 35 30 30 25 25 20 15 15 10 10 - 5 5 0 0 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 - 20 22 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 42 - 42 40 40 38 38 37 37 35 34 34 32 32 30 30 29 29 27 27 26 - 26 24 24 22 22 21 21 19 19 18 18 16 16 15 14 14 13 13 12 - 12 10 10 9 9 8 8 24 24 40 40 57 57 73 73 90 90 106 106 - 123 123 139 156 156 163 163 169 169 176 176 182 182 189 189 195 195 202 202 - 209 209 215 215 222 222 228 228 235 241 241 248 248 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 0 0 5 5 10 10 16 16 21 21 26 26 32 32 37 37 42 42 - 48 48 53 53 59 59 64 69 69 75 75 80 80 85 85 91 91 96 96 - 101 101 107 107 112 112 118 118 123 123 128 128 134 134 139 144 144 150 150 - 155 155 161 161 164 164 168 168 172 172 176 176 180 180 185 185 189 189 193 - 193 197 202 202 208 208 215 215 221 221 228 228 235 235 241 241 248 248 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 251 251 247 247 - 244 244 240 240 237 237 233 233 230 230 226 226 222 222 219 215 215 212 212 - 208 208 205 205 201 201 198 198 187 187 176 176 165 165 154 154 143 143 132 - 132 122 122 111 100 100 89 89 78 78 67 67 57 57 48 48 40 40 32 - 32 24 24 16 16 8 8 0 0 - 0 199 199 200 200 202 202 204 204 206 206 208 208 210 210 212 212 213 213 - 215 215 217 217 219 219 221 223 223 225 225 227 227 228 228 230 230 232 232 - 234 234 236 236 238 238 240 240 241 241 243 243 245 245 247 249 249 251 251 - 253 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 249 249 244 244 238 238 233 227 227 222 222 216 216 211 211 205 205 200 - 200 194 194 189 189 183 183 178 178 173 173 155 155 138 121 121 103 103 86 - 86 69 69 51 51 34 34 39 39 44 44 50 50 55 55 60 60 66 66 - 71 71 76 82 82 80 80 78 78 77 77 75 75 73 73 72 72 70 70 - 68 68 67 67 65 65 63 63 62 60 60 58 58 57 57 58 58 59 59 - 60 60 62 62 63 63 64 64 66 66 67 67 68 68 70 71 71 72 72 - 74 74 75 75 76 76 78 78 81 81 84 84 87 87 90 90 93 93 96 - 96 99 99 102 105 105 108 108 111 111 114 114 117 117 100 100 83 83 66 - 66 50 50 33 33 16 16 0 0 diff --git a/model/aux/idl_twist/palettes/pastels2.ct b/model/aux/idl_twist/palettes/pastels2.ct deleted file mode 100755 index 33bb7d155..000000000 --- a/model/aux/idl_twist/palettes/pastels2.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 154 148 143 143 138 133 128 123 118 118 112 107 102 97 92 87 82 77 - 71 71 66 61 56 51 46 41 41 35 30 25 20 15 10 5 0 6 8 - 10 14 16 20 25 27 31 33 37 39 40 38 35 34 30 29 26 24 21 - 19 16 14 13 10 9 24 40 57 57 73 73 90 90 106 123 123 139 156 - 156 163 169 169 176 176 182 182 189 195 195 202 202 209 209 215 222 222 228 - 228 235 241 241 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 0 5 10 10 16 21 26 32 37 37 42 48 53 59 64 69 75 80 - 85 85 91 96 101 107 112 118 118 123 128 134 139 144 150 155 161 164 168 - 172 180 185 193 202 208 221 228 241 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 251 251 247 247 244 240 240 237 237 233 233 230 - 226 226 222 222 219 215 212 212 208 208 205 205 201 198 198 198 198 198 198 - 198 187 187 187 187 187 187 176 176 176 176 176 176 176 165 165 165 165 165 - 165 154 154 154 154 154 154 143 143 143 143 143 143 143 132 132 132 132 132 - 132 122 122 122 122 122 122 122 111 111 111 100 100 100 100 100 100 89 89 - 89 89 89 89 89 78 78 78 78 78 78 67 67 67 67 67 67 57 57 - 57 57 57 57 57 48 48 48 48 48 48 40 40 40 40 40 40 40 32 - 32 32 32 32 32 24 24 24 24 24 24 16 16 16 16 16 16 16 8 - 8 8 8 8 8 0 0 0 0 - 0 199 200 202 202 204 206 208 210 212 212 213 215 217 219 221 223 225 227 - 228 228 230 232 234 236 238 240 240 241 243 245 247 249 251 253 255 255 255 - 255 255 255 255 255 255 255 255 255 255 249 244 233 227 216 211 200 194 183 - 178 155 121 103 69 51 39 44 50 50 55 55 60 60 66 71 71 76 82 - 82 80 78 78 77 77 75 75 73 72 72 70 70 68 68 67 65 65 63 - 63 62 60 60 58 57 57 58 58 59 59 60 62 62 63 63 64 64 66 - 67 67 68 68 70 71 72 72 74 74 75 75 76 78 78 78 78 78 78 - 78 81 81 81 81 81 81 84 84 84 84 84 84 84 87 87 87 87 87 - 87 90 90 90 90 90 90 93 93 93 93 93 93 93 96 96 96 96 96 - 96 99 99 99 99 99 99 99 102 102 102 105 105 105 105 105 105 108 108 - 108 108 108 108 108 111 111 111 111 111 111 114 114 114 114 114 114 117 117 - 117 117 117 117 117 100 100 100 100 100 100 83 83 83 83 83 83 83 66 - 66 66 66 66 66 50 50 50 50 50 50 33 33 33 33 33 33 33 16 - 16 16 16 16 16 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/pastels3.ct b/model/aux/idl_twist/palettes/pastels3.ct deleted file mode 100755 index a40e14f87..000000000 --- a/model/aux/idl_twist/palettes/pastels3.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 214 210 206 202 198 194 190 186 183 179 175 171 167 163 159 155 152 148 - 144 140 136 132 128 124 121 117 113 109 105 101 97 94 90 86 83 79 75 - 72 68 64 61 57 53 50 46 42 39 40 38 35 34 30 29 26 24 21 - 19 16 14 13 10 9 24 40 57 57 73 73 90 90 106 123 123 139 156 - 156 163 169 169 176 176 182 182 189 195 195 202 202 209 209 215 222 222 228 - 228 235 241 241 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 135 135 136 137 137 138 139 140 140 141 142 143 143 144 145 146 146 147 - 148 149 149 150 151 152 152 153 154 155 155 156 157 158 164 170 176 182 188 - 194 200 206 212 218 224 230 236 242 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 251 251 247 247 244 240 240 237 237 233 233 230 - 226 226 222 222 219 215 212 212 208 208 205 205 201 198 198 198 198 198 198 - 198 187 187 187 187 187 187 176 176 176 176 176 176 176 165 165 165 165 165 - 165 154 154 154 154 154 154 143 143 143 143 143 143 143 132 132 132 132 132 - 132 122 122 122 122 122 122 122 111 111 111 100 100 100 100 100 100 89 89 - 89 89 89 89 89 78 78 78 78 78 78 67 67 67 67 67 67 57 57 - 57 57 57 57 57 48 48 48 48 48 48 40 40 40 40 40 40 40 32 - 32 32 32 32 32 24 24 24 24 24 24 16 16 16 16 16 16 16 8 - 8 8 8 8 8 0 0 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 249 244 233 227 216 211 200 194 183 - 178 155 121 103 69 51 39 44 50 50 55 55 60 60 66 71 71 76 82 - 82 80 78 78 77 77 75 75 73 72 72 70 70 68 68 67 65 65 63 - 63 62 60 60 58 57 57 58 58 59 59 60 62 62 63 63 64 64 66 - 67 67 68 68 70 71 72 72 74 74 75 75 76 78 78 78 78 78 78 - 78 81 81 81 81 81 81 84 84 84 84 84 84 84 87 87 87 87 87 - 87 90 90 90 90 90 90 93 93 93 93 93 93 93 96 96 96 96 96 - 96 99 99 99 99 99 99 99 102 102 102 105 105 105 105 105 105 108 108 - 108 108 108 108 108 111 111 111 111 111 111 114 114 114 114 114 114 117 117 - 117 117 117 117 117 100 100 100 100 100 100 83 83 83 83 83 83 83 66 - 66 66 66 66 66 50 50 50 50 50 50 33 33 33 33 33 33 33 16 - 16 16 16 16 16 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/previmer_hs.ct b/model/aux/idl_twist/palettes/previmer_hs.ct deleted file mode 100755 index 05f199c9e..000000000 --- a/model/aux/idl_twist/palettes/previmer_hs.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 230 219 208 197 186 175 229 227 226 225 224 223 222 221 220 219 218 217 216 - 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 45 90 136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 48 72 - 96 120 144 168 195 207 219 231 243 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 - 248 248 248 249 249 249 249 250 250 250 250 251 251 251 251 252 252 252 252 253 - 253 253 253 254 254 254 254 255 254 253 253 252 251 251 250 249 249 248 247 247 - 246 245 245 244 243 243 242 241 241 240 239 239 238 237 237 236 235 235 234 233 - 233 232 231 231 230 229 229 228 227 227 226 225 225 224 223 223 223 222 221 220 - 219 218 217 216 215 214 213 212 211 210 209 208 208 207 206 205 204 203 202 201 - 200 199 198 197 196 195 194 194 194 194 195 195 196 196 197 197 198 198 198 199 - 199 200 200 201 201 202 202 202 203 203 204 204 205 205 206 206 206 207 207 208 - 208 209 209 210 210 210 211 211 212 212 213 213 214 0 114 0 - 255 230 219 208 197 186 175 0 12 24 36 48 60 72 84 96 108 120 132 144 - 157 0 13 26 39 52 65 78 91 104 117 132 147 163 178 193 209 224 239 255 - 255 255 255 214 218 223 227 232 236 241 245 250 251 252 253 254 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 253 252 249 247 245 242 240 238 236 233 - 231 229 227 224 222 220 218 215 213 211 209 206 204 202 200 197 195 193 191 168 - 162 156 150 144 138 132 126 120 114 108 102 96 90 84 78 71 66 60 54 48 - 42 36 30 24 18 12 6 0 3 6 9 12 15 18 21 24 27 30 33 36 - 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 - 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 139 134 130 125 - 121 116 112 107 103 98 94 89 85 80 76 71 67 62 58 53 49 44 40 35 - 31 26 22 17 13 8 4 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 197 0 - 255 230 219 208 197 186 175 232 233 234 236 237 238 240 241 243 244 245 247 248 - 250 222 225 229 233 236 240 244 247 251 255 255 255 255 255 255 255 255 255 255 - 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 46 69 - 92 115 138 161 168 134 100 67 33 0 6 13 13 13 14 14 15 15 16 16 - 17 17 17 18 18 19 19 20 20 21 21 21 22 22 23 23 24 24 25 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 1 2 4 5 6 8 9 10 12 13 14 16 - 17 18 20 21 22 24 25 26 28 29 30 32 33 34 36 37 38 40 41 42 - 44 45 46 48 49 50 52 53 54 56 57 58 60 61 62 64 62 60 58 56 - 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 - 14 12 10 8 6 4 2 0 2 5 8 11 14 16 19 22 25 28 30 33 - 36 39 42 44 47 50 53 56 58 61 64 67 70 72 75 78 81 84 86 89 - 92 95 98 100 103 106 109 112 114 117 120 123 126 255 110 0 diff --git a/model/aux/idl_twist/palettes/previmer_hs2.ct b/model/aux/idl_twist/palettes/previmer_hs2.ct deleted file mode 100755 index b55a13d1c..000000000 --- a/model/aux/idl_twist/palettes/previmer_hs2.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 230 219 208 197 186 175 229 227 226 225 224 223 222 221 220 219 218 217 216 - 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 45 90 136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 54 - 109 164 174 184 195 202 210 218 226 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 - 248 248 248 249 249 249 249 250 250 250 250 251 251 251 251 252 252 252 252 253 - 253 253 253 254 254 254 254 255 254 253 253 252 251 251 250 249 249 248 247 247 - 246 245 245 244 243 243 242 241 241 240 239 239 238 237 237 236 235 235 234 233 - 233 232 231 231 230 229 229 228 227 227 226 225 225 224 223 223 223 222 221 220 - 219 218 217 216 215 214 213 212 211 210 209 208 208 207 206 205 204 203 202 201 - 200 199 198 197 196 195 194 194 194 194 195 195 196 196 197 197 198 198 198 199 - 199 200 200 201 201 202 202 202 203 203 204 204 205 205 206 206 206 207 207 208 - 208 209 209 210 210 210 211 211 212 212 213 213 214 0 114 0 - 255 230 219 208 197 186 175 0 12 24 36 48 60 72 84 96 108 120 132 144 - 157 0 13 26 39 52 65 78 91 104 117 132 147 163 178 193 209 224 239 255 - 255 255 255 214 218 223 227 232 236 241 245 250 251 255 247 240 232 225 218 230 - 242 255 255 255 255 255 255 255 255 255 253 252 249 247 245 242 240 238 236 233 - 231 229 227 224 222 220 218 215 213 211 209 206 204 202 200 197 195 193 191 168 - 162 156 150 144 138 132 126 120 114 108 102 96 90 84 78 71 66 60 54 48 - 42 36 30 24 18 12 6 0 3 6 9 12 15 18 21 24 27 30 33 36 - 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 - 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 139 134 130 125 - 121 116 112 107 103 98 94 89 85 80 76 71 67 62 58 53 49 44 40 35 - 31 26 22 17 13 8 4 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 197 0 - 255 230 219 208 197 186 175 232 233 234 236 237 238 240 241 243 244 245 247 248 - 250 222 225 229 233 236 240 244 247 251 255 255 255 255 255 255 255 255 255 255 - 255 255 255 0 0 0 0 0 0 0 0 0 0 0 34 69 104 139 174 160 - 146 133 144 156 0 37 75 113 151 0 6 13 13 13 14 14 15 15 16 16 - 17 17 17 18 18 19 19 20 20 21 21 21 22 22 23 23 24 24 25 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 1 2 4 5 6 8 9 10 12 13 14 16 - 17 18 20 21 22 24 25 26 28 29 30 32 33 34 36 37 38 40 41 42 - 44 45 46 48 49 50 52 53 54 56 57 58 60 61 62 64 62 60 58 56 - 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 - 14 12 10 8 6 4 2 0 2 5 8 11 14 16 19 22 25 28 30 33 - 36 39 42 44 47 50 53 56 58 61 64 67 70 72 75 78 81 84 86 89 - 92 95 98 100 103 106 109 112 114 117 120 123 126 255 110 0 diff --git a/model/aux/idl_twist/palettes/previmer_hs3.ct b/model/aux/idl_twist/palettes/previmer_hs3.ct deleted file mode 100755 index 754ecac61..000000000 --- a/model/aux/idl_twist/palettes/previmer_hs3.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 230 219 208 197 186 175 235 234 234 233 233 232 232 231 231 230 230 229 229 - 229 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 45 90 136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 54 - 109 164 174 184 195 202 210 218 226 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 248 - 248 248 248 249 249 249 249 250 250 250 250 251 251 251 251 252 252 252 252 253 - 253 253 253 254 254 254 254 255 254 253 253 252 251 251 250 249 249 248 247 247 - 246 245 245 244 243 243 242 241 241 240 239 239 238 237 237 236 235 235 234 233 - 233 232 231 231 230 229 229 228 227 227 226 225 225 224 223 223 223 222 221 220 - 219 218 217 216 215 214 213 212 211 210 209 208 208 207 206 205 204 203 202 201 - 200 199 198 197 196 195 194 194 194 194 195 195 196 196 197 197 198 198 198 199 - 199 200 200 201 201 202 202 202 203 203 204 204 205 205 206 206 206 207 207 208 - 208 209 209 210 210 210 211 211 212 212 213 213 214 0 114 0 - 255 230 219 208 197 186 175 185 170 156 142 128 113 99 85 71 56 42 28 14 - 0 0 13 26 39 52 65 78 91 104 117 132 147 163 178 193 209 224 239 255 - 255 255 255 214 218 223 227 232 236 241 245 250 251 255 247 240 232 225 218 230 - 242 255 255 255 255 255 255 255 255 255 253 252 249 247 245 242 240 238 236 233 - 231 229 227 224 222 220 218 215 213 211 209 206 204 202 200 197 195 193 191 168 - 162 156 150 144 138 132 126 120 114 108 102 96 90 84 78 71 66 60 54 48 - 42 36 30 24 18 12 6 0 3 6 9 12 15 18 21 24 27 30 33 36 - 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 - 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 139 134 130 125 - 121 116 112 107 103 98 94 89 85 80 76 71 67 62 58 53 49 44 40 35 - 31 26 22 17 13 8 4 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 197 0 - 255 230 219 208 197 186 175 250 248 246 245 243 242 240 239 237 236 234 233 231 - 230 222 225 229 233 236 240 244 247 251 255 255 255 255 255 255 255 255 255 255 - 255 255 255 0 0 0 0 0 0 0 0 0 0 0 34 69 104 139 174 160 - 146 133 144 156 0 37 75 113 151 0 6 13 13 13 14 14 15 15 16 16 - 17 17 17 18 18 19 19 20 20 21 21 21 22 22 23 23 24 24 25 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 1 2 4 5 6 8 9 10 12 13 14 16 - 17 18 20 21 22 24 25 26 28 29 30 32 33 34 36 37 38 40 41 42 - 44 45 46 48 49 50 52 53 54 56 57 58 60 61 62 64 62 60 58 56 - 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 - 14 12 10 8 6 4 2 0 2 5 8 11 14 16 19 22 25 28 30 33 - 36 39 42 44 47 50 53 56 58 61 64 67 70 72 75 78 81 84 86 89 - 92 95 98 100 103 106 109 112 114 117 120 123 126 255 110 0 diff --git a/model/aux/idl_twist/palettes/previmer_hs4.ct b/model/aux/idl_twist/palettes/previmer_hs4.ct deleted file mode 100755 index c2cf789c1..000000000 --- a/model/aux/idl_twist/palettes/previmer_hs4.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 230 219 208 197 186 175 235 234 234 233 233 232 232 231 231 230 230 229 229 - 229 136 122 108 95 81 68 54 40 27 13 0 0 0 0 0 0 0 0 0 - 0 0 0 226 203 180 158 135 113 90 67 45 22 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 248 247 246 245 244 243 242 241 240 239 - 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 - 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 200 - 201 201 202 203 203 204 205 205 206 207 207 208 209 209 210 211 211 212 213 213 - 214 215 215 216 217 217 218 219 219 220 221 221 221 221 221 221 219 218 216 215 - 218 221 224 227 230 233 236 239 242 245 248 251 255 0 114 0 - 255 230 219 208 197 186 175 185 170 156 142 128 113 99 85 71 56 42 28 14 - 0 255 242 230 218 205 193 181 168 156 144 132 120 108 96 84 72 60 48 36 - 24 12 0 255 255 255 255 255 255 255 255 255 255 255 247 240 232 225 218 217 - 217 216 216 216 215 215 214 214 214 255 255 255 255 255 255 255 255 255 255 255 - 251 248 244 241 238 234 231 228 224 221 217 214 211 207 204 201 197 194 191 205 - 202 200 198 196 194 192 190 188 186 184 182 180 178 176 174 172 171 170 169 168 - 167 166 165 164 163 162 161 160 152 144 136 128 120 112 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 - 3 4 6 7 9 10 12 14 15 17 18 20 21 23 25 26 28 29 31 32 - 34 35 37 39 40 42 43 45 46 48 50 50 50 50 50 50 50 50 50 50 - 46 42 38 34 30 26 23 19 15 11 7 3 0 0 197 0 - 255 230 219 208 197 186 175 250 248 246 245 243 242 240 239 237 236 234 233 231 - 230 255 255 255 255 255 255 255 255 255 255 255 252 249 246 244 241 238 235 233 - 230 227 225 151 135 120 105 90 75 60 45 30 15 0 34 69 104 139 174 156 - 139 121 104 87 69 52 34 17 0 89 80 71 62 53 44 35 26 17 8 0 - 1 2 3 5 6 7 9 10 11 13 14 15 17 18 19 21 22 23 25 205 - 202 200 198 196 194 192 190 188 186 184 182 180 178 176 174 172 171 170 169 168 - 167 166 165 164 163 162 161 160 152 144 136 128 120 112 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 - 11 16 22 28 33 39 45 50 56 61 67 73 78 84 90 95 101 106 112 118 - 123 129 135 140 146 151 157 163 168 174 180 180 180 180 180 180 180 180 180 180 - 185 191 197 203 208 214 220 226 231 237 243 249 255 255 110 0 diff --git a/model/aux/idl_twist/palettes/previmer_hs_nogray.ct b/model/aux/idl_twist/palettes/previmer_hs_nogray.ct deleted file mode 100755 index 715695a39..000000000 --- a/model/aux/idl_twist/palettes/previmer_hs_nogray.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 216 211 207 203 199 195 191 187 195 188 181 174 167 160 153 146 139 132 - 125 118 136 122 108 95 81 68 54 40 27 13 0 0 0 0 0 0 0 - 0 0 226 209 192 175 158 141 124 107 90 73 56 39 22 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 185 183 - 181 180 178 176 175 173 171 170 168 166 165 163 161 160 158 156 155 153 151 - 150 148 146 145 143 141 140 138 136 135 133 132 194 191 189 186 184 181 179 - 176 174 171 169 166 164 161 159 156 154 151 149 146 144 141 139 136 134 131 - 129 126 124 121 119 116 114 255 252 249 246 244 241 238 235 233 230 227 224 - 222 219 216 213 211 208 205 202 200 197 194 191 189 186 183 180 178 175 172 - 169 167 164 161 159 1 0 114 0 - 255 196 191 187 182 178 173 169 165 171 159 147 135 123 111 99 87 75 63 - 51 40 255 242 230 218 205 193 181 168 156 144 132 120 102 85 68 51 34 - 17 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 247 240 232 - 225 218 215 212 209 206 204 201 198 195 255 255 255 255 255 255 255 255 255 - 255 255 255 255 247 240 233 226 219 212 205 198 191 186 181 176 171 166 161 - 156 151 146 142 205 202 200 198 196 194 192 190 188 186 184 182 180 178 176 - 174 172 171 170 166 162 159 155 151 148 144 141 137 133 130 126 122 119 115 - 112 105 98 91 84 77 70 63 56 49 42 35 28 21 14 7 0 129 127 - 125 123 121 119 117 115 113 111 109 107 105 103 101 99 97 95 93 91 89 - 87 85 83 81 79 77 75 73 71 69 67 65 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 1 0 197 0 - 255 178 173 168 163 159 154 149 145 255 248 242 235 229 222 216 209 203 196 - 190 184 255 255 255 255 255 255 255 255 255 255 255 252 244 237 229 222 214 - 207 200 151 139 128 117 105 94 83 71 60 49 37 26 15 0 34 69 104 - 139 174 156 139 121 104 87 69 52 34 161 147 134 120 107 93 80 67 53 - 40 26 13 0 1 2 3 4 6 7 8 9 11 9 8 7 6 5 4 - 3 2 1 0 205 202 200 198 196 194 192 190 188 186 184 182 180 178 176 - 174 172 171 170 166 162 159 155 151 148 144 141 137 133 130 126 122 119 115 - 112 105 98 91 84 77 70 63 56 49 42 35 28 21 14 7 0 82 79 - 76 74 71 69 66 64 61 58 56 53 51 48 46 43 41 38 35 33 30 - 28 25 23 20 17 15 12 10 7 5 2 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 255 249 244 239 234 229 224 219 214 209 204 199 - 193 188 183 178 173 168 163 158 153 148 143 138 132 127 122 117 112 107 102 - 97 92 87 82 77 1 255 110 0 diff --git a/model/aux/idl_twist/palettes/previmer_tp_nogray.ct b/model/aux/idl_twist/palettes/previmer_tp_nogray.ct deleted file mode 100644 index 68f1b1ecf..000000000 --- a/model/aux/idl_twist/palettes/previmer_tp_nogray.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 224 216 208 200 193 185 177 170 168 167 166 165 164 163 162 161 163 163 165 - 165 167 172 179 185 192 195 199 189 180 171 161 152 148 138 129 120 111 101 92 - 83 74 64 55 46 37 27 18 9 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 6 13 13 20 28 28 35 43 43 50 57 57 65 72 80 87 94 102 109 - 117 120 124 128 132 136 140 144 148 151 155 159 163 167 175 179 182 186 190 194 - 198 202 206 210 213 217 221 225 229 233 237 241 241 241 242 243 243 244 245 245 - 246 247 248 249 249 250 251 251 252 253 254 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 247 239 232 - 224 224 216 209 201 194 194 186 178 171 163 163 156 0 114 0 - 255 224 213 202 192 181 171 160 150 146 142 138 134 130 126 122 119 113 113 108 - 108 102 91 75 58 42 22 2 5 8 12 15 19 20 24 27 31 34 38 41 - 45 48 51 55 58 62 65 69 72 76 76 88 88 92 97 97 102 107 107 112 - 117 117 122 127 127 132 132 137 142 142 147 152 152 157 162 162 166 171 171 176 - 181 181 186 186 191 196 196 201 206 206 211 216 216 221 226 226 231 236 236 241 - 241 232 233 233 235 236 236 238 239 239 241 242 242 244 245 247 248 250 251 253 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 250 248 243 241 237 232 230 - 226 223 219 214 212 208 203 201 197 194 190 186 184 179 174 171 167 164 159 155 - 152 147 132 132 132 132 124 124 124 124 117 117 117 117 109 109 109 109 102 102 - 102 95 95 95 95 84 84 84 84 73 73 73 73 63 63 63 63 52 52 52 - 42 42 42 42 31 31 31 31 21 21 21 21 10 10 10 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 197 0 - 255 224 217 211 205 199 193 187 181 180 180 180 180 179 179 179 179 184 184 188 - 188 193 202 215 228 242 248 255 254 254 254 254 254 254 254 253 253 253 253 253 - 253 253 252 252 252 252 252 252 252 252 252 251 251 250 250 250 249 249 249 249 - 248 248 248 248 248 247 247 247 247 247 246 246 246 246 245 245 245 244 244 244 - 244 244 243 243 243 243 243 242 242 242 242 241 241 241 241 241 240 240 240 240 - 240 103 99 99 96 93 93 90 87 87 84 81 81 78 75 72 69 66 63 60 - 57 55 53 52 50 48 47 45 44 42 40 39 37 35 32 31 29 27 26 24 - 22 21 19 18 16 14 13 11 9 8 6 5 5 4 4 4 4 3 3 3 - 2 2 2 2 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 255 110 0 diff --git a/model/aux/idl_twist/palettes/raibow+.ct b/model/aux/idl_twist/palettes/raibow+.ct deleted file mode 100755 index 4fbb1534b..000000000 --- a/model/aux/idl_twist/palettes/raibow+.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 4 4 13 13 18 27 27 36 40 40 50 50 54 61 61 68 68 69 - 74 74 79 80 80 83 83 85 86 86 88 86 86 87 87 85 84 84 84 - 84 83 78 78 76 71 71 68 68 60 58 58 53 53 46 40 40 33 25 - 25 16 16 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 4 4 8 8 21 29 29 33 33 46 51 51 63 - 72 72 76 76 89 97 97 101 101 114 119 119 131 140 140 144 144 157 165 - 165 169 182 182 187 187 199 208 208 212 212 225 233 233 242 250 250 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 0 0 - 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 8 16 16 25 25 38 42 42 51 51 63 67 67 - 76 84 84 93 93 106 110 110 119 119 131 135 135 144 152 152 161 161 174 - 178 178 187 187 199 203 203 216 220 220 229 229 242 246 246 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 242 233 233 229 229 216 208 208 199 191 191 187 187 174 165 165 161 161 148 - 140 140 131 123 123 119 119 106 97 97 89 80 80 72 72 63 55 55 51 - 51 38 29 29 21 255 255 0 0 - 255 3 3 10 10 14 23 23 32 38 38 48 48 53 63 63 72 72 77 - 86 86 95 100 100 109 109 113 122 122 132 136 136 145 145 154 159 159 168 - 168 173 182 182 191 195 195 204 204 214 218 218 227 227 232 241 241 250 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 242 242 238 - 238 225 220 220 212 212 199 195 195 187 174 174 170 170 157 152 152 144 144 - 131 127 127 114 106 106 102 102 89 84 84 76 76 63 59 59 46 38 38 - 34 34 21 16 16 8 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 255 255 0 0 diff --git a/model/aux/idl_twist/palettes/rainbowbw.ct b/model/aux/idl_twist/palettes/rainbowbw.ct deleted file mode 100755 index 2208a6fbb..000000000 --- a/model/aux/idl_twist/palettes/rainbowbw.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 4 9 13 18 22 27 31 36 40 45 50 54 58 61 64 68 69 72 - 74 77 79 80 82 83 85 84 86 87 88 86 87 87 87 85 84 84 84 - 83 79 78 77 76 71 70 68 66 60 58 55 53 46 43 40 36 33 25 - 21 16 12 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 4 8 12 21 25 29 33 42 46 51 55 63 - 67 72 76 80 89 93 97 101 110 114 119 123 131 135 140 144 153 157 161 - 165 169 178 182 187 191 199 203 208 212 221 225 229 233 242 246 250 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 0 - 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 4 8 16 21 25 29 38 42 46 51 55 63 67 72 - 76 84 89 93 97 106 110 114 119 127 131 135 140 144 152 157 161 165 174 - 178 182 187 195 199 203 208 216 220 225 229 233 242 246 250 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 250 - 242 238 233 229 221 216 212 208 199 195 191 187 178 174 170 165 161 153 148 - 144 140 131 127 123 119 110 106 102 97 89 85 80 76 72 63 59 55 51 - 42 38 34 29 21 17 12 8 0 - 255 3 7 10 14 19 23 28 32 38 43 48 53 59 63 68 72 77 81 - 86 91 95 100 104 109 113 118 122 127 132 136 141 145 150 154 159 163 168 - 173 177 182 186 191 195 200 204 209 214 218 223 227 232 236 241 245 250 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 246 242 238 - 233 225 220 216 212 203 199 195 191 187 178 174 170 165 157 152 148 144 135 - 131 127 123 114 110 106 102 97 89 84 80 76 67 63 59 55 46 42 38 - 34 25 21 16 12 8 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/ripplescoul.ct b/model/aux/idl_twist/palettes/ripplescoul.ct deleted file mode 100755 index eedfb9f97..000000000 --- a/model/aux/idl_twist/palettes/ripplescoul.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 0 0 0 0 0 0 0 0 0 154 154 148 148 143 138 138 133 128 - 128 123 123 118 112 112 107 107 102 97 97 92 87 82 82 77 71 71 66 - 66 61 56 56 51 51 46 41 41 35 30 30 25 25 20 15 10 10 5 - 0 0 6 6 8 10 10 12 12 14 16 16 18 20 20 22 25 27 27 - 29 29 31 33 33 35 35 37 39 39 42 40 40 38 38 37 35 34 34 - 32 30 30 29 29 27 26 26 24 22 22 21 21 19 18 18 16 16 14 - 14 13 13 12 10 10 9 9 8 24 24 40 57 57 73 73 90 106 106 - 123 123 156 156 163 163 169 176 176 182 189 189 195 195 202 209 209 215 215 - 222 228 228 235 241 248 248 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 0 0 0 0 0 0 0 0 0 0 0 5 5 10 16 16 21 26 - 26 32 32 37 42 42 48 48 53 59 59 64 69 75 75 80 85 85 91 - 91 96 101 101 107 107 112 118 118 123 128 128 134 134 139 144 150 150 155 - 161 161 164 164 168 172 172 176 176 180 185 185 189 193 193 197 202 208 208 - 215 215 221 228 228 235 235 241 248 248 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 251 251 247 247 244 240 240 237 237 233 230 - 230 226 222 222 219 215 215 212 208 208 205 201 201 198 198 187 176 176 165 - 165 154 143 143 132 122 122 111 100 89 89 78 78 67 57 57 48 48 40 - 32 32 24 16 16 8 8 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 199 199 200 200 202 204 204 206 208 - 208 210 210 212 213 213 215 215 217 219 219 221 223 225 225 227 228 228 230 - 230 232 234 234 236 236 238 240 240 241 243 243 245 245 247 249 251 251 253 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 249 249 244 244 238 233 227 227 - 222 216 216 211 211 205 200 200 194 189 189 183 183 178 173 173 155 155 121 - 121 103 103 86 69 69 51 51 34 39 39 44 50 50 55 55 60 66 66 - 71 71 82 82 80 80 78 77 77 75 73 73 72 72 70 68 68 67 67 - 65 63 63 62 60 58 58 57 58 58 59 59 60 62 62 63 63 64 66 - 66 67 68 68 70 71 71 72 74 74 75 76 76 78 78 81 84 84 87 - 87 90 93 93 96 99 99 102 105 108 108 111 111 114 117 117 100 100 83 - 66 66 50 33 33 16 16 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/ripplesgrey.ct b/model/aux/idl_twist/palettes/ripplesgrey.ct deleted file mode 100755 index cd31dd734..000000000 --- a/model/aux/idl_twist/palettes/ripplesgrey.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 254 254 253 253 252 252 252 251 251 250 250 249 249 249 248 248 247 - 247 246 246 246 245 245 244 244 243 243 243 242 242 241 241 241 240 240 239 - 239 238 238 238 237 237 236 236 235 235 235 234 234 233 233 232 232 232 231 - 231 230 230 230 229 229 228 228 227 227 227 226 226 225 225 224 224 224 223 - 223 222 222 221 221 221 220 220 219 219 219 218 218 217 217 216 216 216 215 - 215 214 214 213 213 213 212 212 211 211 210 210 210 209 209 208 208 207 207 - 207 206 206 205 205 205 204 204 203 203 202 202 202 201 201 200 200 199 199 - 199 198 198 197 197 196 196 196 195 195 194 194 194 193 193 192 192 191 191 - 191 190 190 189 189 188 188 188 187 187 186 186 185 185 185 184 184 183 183 - 183 181 180 178 177 176 174 173 171 170 169 167 166 164 163 162 160 159 158 - 156 155 153 152 151 149 148 146 145 144 142 141 140 138 137 135 134 133 131 - 130 128 127 126 124 123 122 120 119 117 116 115 113 112 110 109 108 106 105 - 104 102 101 99 98 97 95 94 92 91 90 88 87 86 84 83 81 80 79 - 77 76 74 73 72 70 69 68 255 - 0 255 254 254 253 253 252 252 252 251 251 250 250 249 249 249 248 248 247 - 247 246 246 246 245 245 244 244 243 243 243 242 242 241 241 241 240 240 239 - 239 238 238 238 237 237 236 236 235 235 235 234 234 233 233 232 232 232 231 - 231 230 230 230 229 229 228 228 227 227 227 226 226 225 225 224 224 224 223 - 223 222 222 221 221 221 220 220 219 219 219 218 218 217 217 216 216 216 215 - 215 214 214 213 213 213 212 212 211 211 210 210 210 209 209 208 208 207 207 - 207 206 206 205 205 205 204 204 203 203 202 202 202 201 201 200 200 199 199 - 199 198 198 197 197 196 196 196 195 195 194 194 194 193 193 192 192 191 191 - 191 190 190 189 189 188 188 188 187 187 186 186 185 185 185 184 184 183 183 - 183 181 180 178 177 176 174 173 171 170 169 167 166 164 163 162 160 159 158 - 156 155 153 152 151 149 148 146 145 144 142 141 140 138 137 135 134 133 131 - 130 128 127 126 124 123 122 120 119 117 116 115 113 112 110 109 108 106 105 - 104 102 101 99 98 97 95 94 92 91 90 88 87 86 84 83 81 80 79 - 77 76 74 73 72 70 69 68 255 - 0 255 254 254 253 253 252 252 252 251 251 250 250 249 249 249 248 248 247 - 247 246 246 246 245 245 244 244 243 243 243 242 242 241 241 241 240 240 239 - 239 238 238 238 237 237 236 236 235 235 235 234 234 233 233 232 232 232 231 - 231 230 230 230 229 229 228 228 227 227 227 226 226 225 225 224 224 224 223 - 223 222 222 221 221 221 220 220 219 219 219 218 218 217 217 216 216 216 215 - 215 214 214 213 213 213 212 212 211 211 210 210 210 209 209 208 208 207 207 - 207 206 206 205 205 205 204 204 203 203 202 202 202 201 201 200 200 199 199 - 199 198 198 197 197 196 196 196 195 195 194 194 194 193 193 192 192 191 191 - 191 190 190 189 189 188 188 188 187 187 186 186 185 185 185 184 184 183 183 - 183 181 180 178 177 176 174 173 171 170 169 167 166 164 163 162 160 159 158 - 156 155 153 152 151 149 148 146 145 144 142 141 140 138 137 135 134 133 131 - 130 128 127 126 124 123 122 120 119 117 116 115 113 112 110 109 108 106 105 - 104 102 101 99 98 97 95 94 92 91 90 88 87 86 84 83 81 80 79 - 77 76 74 73 72 70 69 68 255 diff --git a/model/aux/idl_twist/palettes/s.ct b/model/aux/idl_twist/palettes/s.ct deleted file mode 100755 index 710e17803..000000000 --- a/model/aux/idl_twist/palettes/s.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 85 85 82 82 78 78 75 75 69 66 66 62 62 57 57 54 54 50 - 50 47 41 41 38 38 34 34 29 29 26 22 22 19 19 13 13 10 10 - 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 25 25 25 - 25 38 38 50 50 50 63 63 76 76 76 76 88 88 101 114 114 114 114 - 114 114 126 126 126 126 139 152 152 152 152 165 165 165 165 189 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 - 0 5 5 5 5 6 6 7 7 8 9 9 9 9 10 10 11 11 12 - 12 13 14 14 14 14 15 15 16 16 17 18 18 18 18 20 20 20 20 - 21 21 22 22 22 23 23 37 37 37 37 52 66 66 66 66 81 81 95 - 95 110 110 110 124 124 139 139 139 139 153 153 168 168 168 182 182 197 197 - 211 211 211 226 226 240 240 240 240 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 241 241 241 228 228 214 214 214 214 201 201 201 188 - 188 174 174 174 174 161 161 161 148 148 127 127 127 127 127 127 110 110 110 - 102 102 102 102 89 89 80 80 80 72 72 59 59 59 59 55 55 55 55 - 42 34 34 34 34 0 0 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 239 239 239 223 223 207 207 191 - 191 191 191 175 159 159 159 159 143 143 127 127 127 127 111 95 95 79 79 - 79 79 63 63 47 47 47 31 31 15 15 15 15 0 12 12 25 25 25 - 25 38 38 50 50 50 63 63 76 76 76 76 88 88 101 114 114 114 114 - 114 114 126 126 126 126 139 152 152 152 152 165 165 165 165 189 223 223 223 - 223 195 195 195 195 167 167 139 139 139 111 111 111 111 83 83 55 55 55 - 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/s2.ct b/model/aux/idl_twist/palettes/s2.ct deleted file mode 100755 index a0d3c7754..000000000 --- a/model/aux/idl_twist/palettes/s2.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 193 193 190 188 186 186 184 182 182 180 178 176 176 174 172 172 170 168 - 166 166 164 162 162 160 158 158 156 153 151 151 149 147 147 145 143 141 141 - 139 137 137 135 133 131 131 129 127 127 125 123 121 121 119 117 117 114 112 - 110 110 108 106 106 104 102 100 100 98 96 96 94 92 92 90 88 86 86 - 84 82 82 80 78 75 75 73 71 71 69 67 65 65 63 61 61 59 57 - 55 55 53 51 51 49 47 45 45 43 41 41 39 36 36 34 32 30 30 - 28 26 26 24 22 20 20 18 16 16 14 12 10 10 8 6 6 4 2 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 25 50 50 75 100 125 125 150 175 175 - 200 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 246 238 238 230 222 222 214 206 198 198 190 182 182 174 166 - 158 158 150 142 142 134 126 255 255 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 10 21 21 31 42 53 53 63 74 74 85 95 106 106 116 127 127 - 138 148 148 159 170 180 180 191 201 201 212 223 233 233 244 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 238 221 221 205 188 188 172 155 139 139 122 106 106 89 73 - 68 68 63 59 59 54 50 45 45 41 36 36 31 27 22 22 18 13 13 - 9 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 223 191 - 159 159 127 95 95 63 31 0 0 25 50 50 75 100 125 125 150 175 175 - 200 230 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/s3_1.ct b/model/aux/idl_twist/palettes/s3_1.ct deleted file mode 100755 index cb692675b..000000000 --- a/model/aux/idl_twist/palettes/s3_1.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 193 190 186 184 182 180 176 174 172 168 166 164 162 158 156 151 149 147 - 145 141 139 137 133 131 129 127 123 121 117 117 112 110 106 104 100 100 96 - 94 92 88 86 84 82 78 75 71 69 67 65 61 59 55 53 51 49 45 - 43 41 36 36 34 32 30 28 26 24 22 20 18 16 16 12 10 10 6 - 6 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 25 25 50 50 50 50 50 75 - 75 100 100 100 125 125 125 125 150 150 150 175 175 175 175 200 200 200 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 246 238 238 230 222 222 214 206 198 198 190 182 182 174 166 - 158 158 150 142 142 134 126 255 255 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 10 21 31 42 53 63 74 85 95 106 116 116 116 127 127 - 127 127 127 138 138 148 148 148 148 148 159 159 170 170 180 180 180 180 180 - 191 191 201 201 201 201 201 212 212 223 223 223 233 233 233 233 244 244 244 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 238 221 221 205 188 188 172 155 139 139 122 106 106 89 73 - 68 68 63 59 59 54 50 45 45 41 36 36 31 27 22 22 18 13 13 - 9 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 - 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 223 223 223 191 191 159 159 159 159 159 127 127 95 95 95 - 95 95 63 63 31 31 0 0 0 0 0 25 25 50 50 50 50 50 75 - 75 100 100 100 125 125 125 125 150 150 150 175 175 175 175 200 200 200 255 - 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/symbols.ct b/model/aux/idl_twist/palettes/symbols.ct deleted file mode 100755 index 2374bc735..000000000 --- a/model/aux/idl_twist/palettes/symbols.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 200 197 194 191 188 185 183 183 183 183 177 177 177 177 170 170 170 170 164 - 164 164 164 164 158 158 158 158 161 161 161 161 163 163 163 163 165 165 165 165 - 167 170 172 176 179 183 185 188 192 194 199 199 199 190 186 186 182 182 178 174 - 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 128 128 128 124 - 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 6 13 20 27 41 48 55 55 62 68 82 89 - 96 103 103 117 124 130 137 144 158 158 165 172 179 186 192 192 192 199 199 206 - 206 213 213 213 213 220 220 220 227 227 227 234 234 234 234 241 241 241 248 248 - 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 - 255 200 196 192 188 184 180 176 176 176 176 163 163 163 163 150 150 150 150 137 - 137 137 137 137 124 124 124 124 119 119 119 119 113 113 113 113 108 108 108 108 - 102 97 91 80 75 64 58 53 42 36 2 2 2 3 4 4 5 5 5 6 - 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 14 14 14 15 - 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 76 88 87 87 86 - 86 85 85 84 84 83 83 83 82 82 81 81 80 80 79 79 78 78 78 77 - 77 76 76 75 75 74 74 74 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 250 246 244 240 240 237 235 231 229 225 222 218 214 214 212 210 207 203 - 203 197 197 192 188 188 186 186 184 182 177 177 177 173 173 171 169 169 169 167 - 167 165 161 161 153 148 148 148 148 144 131 131 127 123 123 119 119 110 110 97 - 97 97 59 42 34 17 0 0 0 0 0 0 0 0 0 0 - 255 200 197 195 193 191 189 187 187 187 187 184 184 184 184 181 181 181 181 178 - 178 178 178 178 175 175 175 175 179 179 179 179 184 184 184 184 188 188 188 188 - 193 197 202 210 215 224 228 233 242 246 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 252 251 250 250 249 - 249 249 248 248 248 247 247 247 246 246 246 245 245 244 244 244 243 243 243 242 - 242 242 241 241 241 240 240 240 103 100 97 94 88 85 83 83 80 77 71 68 - 65 63 63 57 54 51 48 45 40 40 37 34 31 28 25 25 25 22 22 20 - 20 17 17 17 17 14 14 14 11 11 11 8 8 8 8 5 5 5 2 2 - 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/symbols_dark.ct b/model/aux/idl_twist/palettes/symbols_dark.ct deleted file mode 100644 index 37dbacd31..000000000 --- a/model/aux/idl_twist/palettes/symbols_dark.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 200 197 194 191 188 185 183 183 183 183 177 177 177 177 170 170 170 170 164 - 164 164 164 164 158 158 158 158 161 161 161 161 163 163 163 163 165 165 165 165 - 167 170 172 176 179 183 185 188 192 194 199 199 199 190 186 186 182 182 178 174 - 169 165 161 157 157 153 153 153 153 149 145 140 140 136 132 132 128 128 128 124 - 120 116 111 107 103 99 99 99 87 74 70 37 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 6 5 5 5 5 5 5 5 5 5 5 5 - 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 - 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 - 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 207 208 210 211 213 214 216 217 219 221 222 224 - 225 227 228 230 231 233 234 236 238 239 241 242 244 245 247 248 250 251 253 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 - 255 200 196 192 188 184 180 176 176 176 176 163 163 163 163 150 150 150 150 137 - 137 137 137 137 124 124 124 124 119 119 119 119 113 113 113 113 108 108 108 108 - 102 97 91 80 75 64 58 53 42 36 2 2 2 3 4 4 5 5 5 6 - 7 8 8 9 9 10 10 10 10 11 11 12 12 13 14 14 14 14 14 15 - 16 17 17 18 19 20 20 20 22 24 25 31 38 47 60 76 88 87 87 86 - 86 85 85 84 84 83 83 83 82 82 81 81 80 80 79 79 78 78 78 77 - 77 76 76 75 75 74 74 74 255 253 251 249 248 246 244 243 241 239 238 236 - 234 232 231 229 227 226 224 222 221 219 217 215 214 212 210 209 207 205 204 202 - 200 199 197 195 193 192 190 188 187 185 183 182 180 178 176 175 173 171 170 168 - 166 165 163 161 160 158 156 154 153 151 149 148 146 144 143 141 139 137 136 134 - 132 131 129 127 126 124 122 121 120 120 119 118 117 117 116 115 114 113 113 112 - 111 110 110 109 108 107 107 106 105 104 103 103 102 101 100 100 99 98 97 97 - 97 97 59 42 34 17 0 0 0 0 0 0 0 0 0 0 - 255 200 197 195 193 191 189 187 187 187 187 184 184 184 184 181 181 181 181 178 - 178 178 178 178 175 175 175 175 179 179 179 179 184 184 184 184 188 188 188 188 - 193 197 202 210 215 224 228 233 242 246 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 254 253 252 251 250 250 249 - 249 249 248 248 248 247 247 247 246 246 246 245 245 244 244 244 243 243 243 242 - 242 242 241 241 241 240 240 240 103 101 100 99 98 96 95 94 93 92 90 89 - 88 87 86 84 83 82 81 80 78 77 76 75 74 72 71 70 69 68 66 65 - 64 63 62 60 59 58 57 56 54 53 52 51 50 48 47 46 45 44 42 41 - 40 39 38 36 35 34 33 32 30 29 28 27 26 24 23 22 21 20 18 17 - 16 15 14 12 11 10 9 8 7 7 7 7 6 6 6 6 5 5 5 5 - 4 4 4 4 3 3 3 3 2 2 2 2 1 1 1 1 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/topobathy.ct b/model/aux/idl_twist/palettes/topobathy.ct deleted file mode 100644 index 4dc071525..000000000 --- a/model/aux/idl_twist/palettes/topobathy.ct +++ /dev/null @@ -1,39 +0,0 @@ - 255 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 - 159 158 157 156 155 154 153 152 151 150 149 148 148 138 129 120 111 101 92 83 - 74 74 69 69 64 64 60 60 55 50 50 46 46 41 41 37 32 32 27 27 - 23 23 18 18 13 9 9 4 4 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 6 6 13 13 20 20 28 35 35 43 43 50 50 - 57 57 65 72 72 80 80 87 87 94 102 102 109 109 117 117 120 124 140 159 - 179 182 186 190 194 198 202 206 210 213 217 221 225 229 233 237 241 241 241 241 - 242 242 243 243 244 244 245 245 245 246 246 247 247 248 248 249 249 250 250 250 - 251 251 252 252 253 253 254 254 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 250 246 242 238 233 229 225 221 216 212 208 204 200 0 0 - 255 88 85 83 81 79 77 74 72 70 68 66 63 61 59 57 55 52 50 48 - 46 44 41 39 37 35 33 30 28 26 24 22 20 24 27 31 34 38 41 45 - 48 48 50 50 51 51 53 53 55 57 57 58 58 60 60 62 63 63 65 65 - 67 67 69 69 70 72 72 74 74 76 76 88 92 92 97 97 102 102 107 112 - 112 117 117 122 122 127 127 132 137 137 142 142 147 147 152 157 157 162 162 166 - 166 171 171 176 181 181 186 186 191 191 196 201 201 206 206 211 211 216 221 221 - 226 226 231 231 236 236 241 232 232 233 233 235 235 236 238 238 239 239 241 241 - 242 242 244 245 245 247 247 248 248 250 251 251 253 253 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 252 250 - 248 246 243 241 239 237 234 232 230 228 226 223 221 219 217 214 212 210 208 206 - 203 201 199 197 194 192 190 188 186 184 181 179 176 174 171 169 167 164 162 159 - 157 155 152 150 147 139 132 124 117 109 102 95 84 73 63 52 42 31 21 10 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 255 250 250 250 250 250 250 250 250 251 251 251 251 251 251 251 251 252 252 252 - 252 252 252 252 252 253 253 253 253 253 253 253 254 254 253 253 253 253 253 253 - 253 253 253 253 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 - 252 252 252 252 252 252 252 252 252 252 252 251 250 250 250 250 249 249 249 249 - 249 248 248 248 248 248 248 247 247 247 247 247 246 246 246 246 246 245 245 245 - 245 244 244 244 244 244 243 243 243 243 243 242 242 242 242 242 242 241 241 241 - 241 241 240 240 240 240 240 103 103 99 99 96 96 93 90 90 87 87 84 84 - 81 81 78 75 75 72 72 69 69 66 63 63 60 60 57 57 55 53 47 39 - 31 29 27 26 24 22 21 19 18 16 14 13 11 9 8 6 5 5 4 4 - 4 4 4 4 3 3 3 3 3 3 2 2 2 2 2 2 1 1 1 1 - 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 diff --git a/model/aux/idl_twist/palettes/wavespec_new.ct b/model/aux/idl_twist/palettes/wavespec_new.ct deleted file mode 100755 index 74d12d386..000000000 --- a/model/aux/idl_twist/palettes/wavespec_new.ct +++ /dev/null @@ -1,42 +0,0 @@ - 255 255 241 228 214 201 187 174 161 149 137 125 113 101 89 77 72 67 62 - 57 52 48 43 38 33 28 24 19 14 9 4 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 4 8 12 16 20 24 28 32 36 40 45 49 53 57 61 65 69 73 - 77 81 85 90 94 98 102 106 110 114 118 122 126 131 134 138 142 146 150 - 154 158 162 165 169 173 177 181 185 189 193 196 200 204 208 212 216 220 224 - 227 231 235 239 243 247 251 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 251 248 245 242 239 236 233 - 230 227 224 221 218 215 212 209 0 - 255 255 233 211 190 168 146 125 109 93 78 62 46 31 15 0 3 6 10 - 13 17 20 24 27 30 34 37 41 44 48 51 55 62 70 78 86 94 102 - 110 118 126 134 142 150 158 166 174 182 185 189 193 197 200 204 208 212 215 - 219 223 227 230 234 238 242 242 242 243 243 244 244 244 245 245 246 246 246 - 247 247 248 248 248 249 249 250 250 250 251 251 252 252 252 253 253 254 254 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 252 249 246 243 240 238 235 232 229 226 224 - 221 218 215 212 210 207 204 201 198 195 193 190 187 184 181 179 176 173 170 - 167 165 162 160 158 156 153 151 149 147 145 142 140 138 136 133 131 129 127 - 125 122 120 118 116 113 111 109 107 105 102 100 98 96 94 88 83 77 72 - 66 61 55 50 45 39 34 28 23 17 12 7 6 6 5 5 4 4 3 - 3 2 2 1 1 0 0 0 0 - 255 255 250 245 240 235 230 225 220 215 210 205 200 195 190 186 190 194 198 - 203 207 211 216 220 224 229 233 237 242 246 250 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 251 248 245 242 238 235 232 229 226 222 219 216 - 213 209 206 203 200 197 193 190 187 184 180 177 174 171 168 164 161 158 155 - 152 147 142 137 133 128 123 118 114 109 104 99 95 90 85 80 76 71 66 - 61 57 52 47 42 38 33 28 23 19 14 9 4 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 diff --git a/model/aux/idl_twist/palettes/wbw.ct b/model/aux/idl_twist/palettes/wbw.ct deleted file mode 100755 index dac4edf5c..000000000 --- a/model/aux/idl_twist/palettes/wbw.ct +++ /dev/null @@ -1,42 +0,0 @@ - 0 255 255 251 251 250 246 246 245 245 243 240 240 238 236 236 233 233 231 - 230 230 227 227 225 222 222 220 220 218 215 215 213 212 212 208 208 207 205 - 205 202 202 200 197 197 195 195 194 190 190 189 189 187 184 184 182 180 180 - 177 177 176 172 172 171 171 169 166 166 164 164 162 159 159 157 157 156 153 - 153 151 148 148 146 146 144 141 141 139 139 138 134 134 133 133 131 128 128 - 126 123 123 121 121 120 116 116 115 115 113 110 110 108 108 106 106 106 108 - 108 108 110 110 110 111 111 111 111 113 113 113 115 115 115 116 116 118 118 - 118 120 120 120 120 121 121 121 123 123 123 125 125 125 126 126 128 128 128 - 129 129 131 131 133 134 134 136 138 138 139 139 139 141 141 143 143 144 146 - 146 148 148 149 151 151 153 153 156 159 159 162 166 166 169 169 172 176 176 - 179 179 182 185 185 189 189 192 195 195 199 199 202 205 205 208 212 212 215 - 215 218 222 222 225 225 228 228 228 230 230 231 231 231 233 235 235 235 235 - 236 238 238 238 238 240 241 241 241 241 243 245 245 245 245 246 248 248 248 - 250 250 251 251 251 253 253 255 255 - 0 255 255 251 251 250 246 246 245 245 243 240 240 238 236 236 233 233 231 - 230 230 227 227 225 222 222 220 220 218 215 215 213 212 212 208 208 207 205 - 205 202 202 200 197 197 195 195 194 190 190 189 189 187 184 184 182 180 180 - 177 177 176 172 172 171 171 169 166 166 164 164 162 159 159 157 157 156 153 - 153 151 148 148 146 146 144 141 141 139 139 138 134 134 133 133 131 128 128 - 126 123 123 121 121 120 116 116 115 115 113 110 110 108 108 106 106 106 108 - 108 108 110 110 110 111 111 111 111 113 113 113 115 115 115 116 116 118 118 - 118 120 120 120 120 121 121 121 123 123 123 125 125 125 126 126 128 128 128 - 129 129 131 131 133 134 134 136 138 138 139 139 139 141 141 143 143 144 146 - 146 148 148 149 151 151 153 153 156 159 159 162 166 166 169 169 172 176 176 - 179 179 182 185 185 189 189 192 195 195 199 199 202 205 205 208 212 212 215 - 215 218 222 222 225 225 228 228 228 230 230 231 231 231 233 235 235 235 235 - 236 238 238 238 238 240 241 241 241 241 243 245 245 245 245 246 248 248 248 - 250 250 251 251 251 253 253 255 255 - 0 255 255 251 251 250 246 246 245 245 243 240 240 238 236 236 233 233 231 - 230 230 227 227 225 222 222 220 220 218 215 215 213 212 212 208 208 207 205 - 205 202 202 200 197 197 195 195 194 190 190 189 189 187 184 184 182 180 180 - 177 177 176 172 172 171 171 169 166 166 164 164 162 159 159 157 157 156 153 - 153 151 148 148 146 146 144 141 141 139 139 138 134 134 133 133 131 128 128 - 126 123 123 121 121 120 116 116 115 115 113 110 110 108 108 106 106 106 108 - 108 108 110 110 110 111 111 111 111 113 113 113 115 115 115 116 116 118 118 - 118 120 120 120 120 121 121 121 123 123 123 125 125 125 126 126 128 128 128 - 129 129 131 131 133 134 134 136 138 138 139 139 139 141 141 143 143 144 146 - 146 148 148 149 151 151 153 153 156 159 159 162 166 166 169 169 172 176 176 - 179 179 182 185 185 189 189 192 195 195 199 199 202 205 205 208 212 212 215 - 215 218 222 222 225 225 228 228 228 230 230 231 231 231 233 235 235 235 235 - 236 238 238 238 238 240 241 241 241 241 243 245 245 245 245 246 248 248 248 - 250 250 251 251 251 253 253 255 255 diff --git a/model/aux/idl_twist/palettes/ws_ftp.log b/model/aux/idl_twist/palettes/ws_ftp.log deleted file mode 100755 index 4db0cff2f..000000000 --- a/model/aux/idl_twist/palettes/ws_ftp.log +++ /dev/null @@ -1,26 +0,0 @@ -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\6coul.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES 6coul.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\backtoblack.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES backtoblack.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bathy.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bathy.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bathy2.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bathy2.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bathy3.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bathy3.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bathy3white.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bathy3white.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bathy4.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bathy4.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bathygif.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bathygif.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\bwflipped.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES bwflipped.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\Depth.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES Depth.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\E.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES E.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\fe.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES fe.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\Hs.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES Hs.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\JFM8a.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES JFM8a.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\ONR2000.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES ONR2000.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\pastels.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES pastels.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\pastels2.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES pastels2.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\pastels3.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES pastels3.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\raibow+.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES raibow+.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\rainbowbw.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES rainbowbw.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\ripplescoul.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES ripplescoul.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\ripplesgrey.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES ripplesgrey.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\S.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES S.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\S2.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES S2.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\symbols.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES symbols.ct -101.07.19 16:41 B C:\Fabrice\IDL\PALETTES\wbw.ct <-- padre /tmp_mnt/data/ter7/ardhuin/IDL/PALETTES wbw.ct diff --git a/model/aux/idl_twist/palettes/z_dopsat_red.ct b/model/aux/idl_twist/palettes/z_dopsat_red.ct deleted file mode 100644 index 80289e959..000000000 --- a/model/aux/idl_twist/palettes/z_dopsat_red.ct +++ /dev/null @@ -1,39 +0,0 @@ - 0 242 218 194 218 214 210 206 202 198 194 190 186 182 178 175 161 143 124 106 - 87 74 55 37 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 6 20 35 43 57 65 80 94 102 117 120 128 132 140 148 - 151 159 163 171 175 182 190 194 202 206 213 221 221 225 225 229 229 233 233 237 - 237 241 241 241 241 241 241 241 241 242 242 242 242 243 243 243 243 244 244 244 - 244 245 245 245 245 245 246 246 246 246 247 247 247 247 248 248 248 248 249 249 - 249 249 250 250 250 250 250 250 251 251 251 251 252 252 252 253 253 253 253 254 - 254 254 254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 249 244 239 233 228 223 217 212 207 201 196 191 0 0 255 - 0 240 210 180 210 191 173 155 137 119 100 82 64 46 28 10 15 22 29 36 - 43 48 55 62 69 76 102 107 117 122 132 137 147 157 162 171 176 186 191 201 - 211 216 226 231 241 232 235 238 239 242 244 247 250 251 255 255 255 255 255 255 - 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 - 255 255 255 255 255 252 252 250 250 248 248 246 246 243 243 241 241 239 239 237 - 237 234 232 232 230 230 228 228 226 226 223 223 221 221 219 219 217 217 214 214 - 212 212 210 210 208 208 206 206 203 203 201 201 199 197 197 194 194 192 192 190 - 190 188 188 186 186 184 184 181 181 179 179 176 176 174 174 171 171 169 169 167 - 167 164 162 162 162 159 159 157 157 157 155 155 152 152 152 150 150 147 147 147 - 145 145 143 143 143 140 140 138 138 135 135 135 133 133 131 131 131 131 131 127 - 127 127 123 123 123 123 123 119 119 119 119 110 110 110 110 110 97 97 97 89 - 89 82 82 82 74 74 67 67 67 59 59 52 52 44 44 44 37 37 29 29 - 29 26 24 21 19 16 14 12 9 7 4 2 0 0 0 255 - 0 244 223 202 223 225 228 231 234 237 239 242 245 248 251 254 254 254 253 253 - 253 253 252 252 252 252 249 249 248 248 247 247 246 246 245 244 244 243 243 242 - 242 241 241 240 240 103 96 90 87 81 78 72 66 63 57 55 52 50 47 44 - 42 39 37 34 32 29 26 24 21 19 16 13 13 11 11 9 9 8 8 6 - 6 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 - 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 - 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 160 0 255 diff --git a/model/aux/idl_twist/parametros.pro b/model/aux/idl_twist/parametros.pro deleted file mode 100755 index 4d09bd48e..000000000 --- a/model/aux/idl_twist/parametros.pro +++ /dev/null @@ -1,332 +0,0 @@ -;/ -;/ +-----------------------------------+ -;/ | TWIST Ifremer-SHOM | -;/ | F. Ardhuin | -;/ | IDL command language | -;/ | Last update : 17-Oct-2013 | -;/ +-----------------------------------+ -;/ -;/ Licence information: This code is distributed under the CeCILL license -;/ generally compatible with the Gnu Public Licence (GPL) -;/ http://www.cecill.info/index.en.html -;/ -;/ 17-Oct-2013 : Clean up ( version 2.00 ) -;---------------------------------------------------------------------------- -PRO parametros, anterior_root -;---------------------------------------------------------------------------- -; This procedure generates the widgets of the parameters subwindow -; for the TWIST visualization tool -;---------------------------------------------------------------------------- -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON OVERLAY2,adbathydot,adcontour -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON WPARAM,WParray,root,WParam5,WParam6 - - pbase=LONG(0) - vecbase=LONG(0) - Line1=LONG(0) - WPbox=lonarr(8) - WPline=LONARR(15) - WParray=LONARR(15,16) - -; Guardar valores en variables temporales - root=anterior_root -; WIDGET_CONTROL, root, SENSITIVE=0 - - - pbase = WIDGET_BASE(TITLE='Display and Print parameters', /COLUMN) - WIDGET_CONTROL, pbase, GROUP_LEADER=root - i=0 - WPbox(i)=WIDGET_BASE(pbase, /FRAME, /COLUMN) - j=0 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='CONTOUR Num. Levels: ') - WParray(j,1)=WIDGET_TEXT(WPline(j),/EDITABLE, XSIZE=5, YSIZE=1, $ - VALUE=STRCOMPRESS(String(numlevels))) - WParray(j,2)= WIDGET_DROPLIST(WPline(j), $ - VALUE=['linear','log4','log6','duck shelf','Shields Number']) - WParray(j,3)= WIDGET_DROPLIST(WPline(j), $ - VALUE=['no contour','solid','dotted','dashed','solid/dashed']) - j=1 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)= WIDGET_DROPLIST(WPline(j), $ - VALUE=['Plot data','Plot log10(data)']) - WParray(j,1)= WIDGET_DROPLIST(WPline(j), $ - VALUE=['Fit range to data','Fixed range']) - WParray(j,2)= WIDGET_DROPLIST(WPline(j), $ - VALUE=['Fill out of range','Blank out of range']) - - i=1 - WPbox(i)=WIDGET_BASE(pbase, /FRAME, /COLUMN) - j=2 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='3D views:') - WParray(j,1)=WIDGET_SLIDER(WPline(j), MAXIMUM=180, MINIMUM=0, value=ax3D, $ - TITLE='Ax') - WParray(j,2)=WIDGET_SLIDER(WPline(j), MAXIMUM=360, MINIMUM=0, value=az3D, $ - TITLE='Az') - WParray(j,3)=WIDGET_LABEL(WPline(j),VALUE='Smooth:') - WParray(j,4)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - XSIZE=4,YSIZE=1,VALUE=strcompress(string(smoothing))) - WParray(j,5)=WIDGET_LABEL(WPline(j),VALUE='N. bins:') - WParray(j,6)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - XSIZE=4,YSIZE=1,VALUE=strcompress(string(nbins))) - - i=i+1 - WPbox(i)=WIDGET_BASE(pbase, /FRAME, /COLUMN) - j=3 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='Title:') - WParray(j,1)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='xTitle:') - WParray(j,3)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,4)=WIDGET_LABEL(WPline(j),VALUE='yTitle:') - WParray(j,5)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,6)=WIDGET_LABEL(WPline(j),VALUE='cbTitle:') - WParray(j,7)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,8)=WIDGET_BUTTON(WPline(j),VALUE='Font') - j=4 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='Color bar:') - WParray(j,1)=WIDGET_DROPLIST(WPline(j),VALUE=['on','off']) - WParray(j,2)=WIDGET_DROPLIST(WPline(j),VALUE=['exact range','rounded range']) - WParray(j,3)=WIDGET_LABEL(WPline(j),VALUE='N ticks:') - WParray(j,4)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - XSIZE=4,YSIZE=1,VALUE=strcompress(string(cbnticks))) - - i=i+1 - WPbox(i)=WIDGET_BASE(pbase, /FRAME, /COLUMN) - j=5 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='blx:') - WParray(j,1)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(blx,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='bly:') - WParray(j,3)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(bly,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,4)=WIDGET_LABEL(WPline(j),VALUE='trx:') - WParray(j,5)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(trx,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,6)=WIDGET_LABEL(WPline(j),VALUE='try:') - WParray(j,7)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(try,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,8)=WIDGET_LABEL(WPline(j),VALUE='tx:') - WParray(j,9)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(textx,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,10)=WIDGET_LABEL(WPline(j),VALUE='ty:') - WParray(j,11)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(texty,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,12)=WIDGET_LABEL(WPline(j),VALUE='tdy:') - WParray(j,13)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(textdx,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,14)=WIDGET_LABEL(WPline(j),VALUE='tdy:') - WParray(j,15)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(textdy,FORMAT='(F5.3)'),/EDITABLE) - j=6 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='cbblx:') - WParray(j,1)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(cbblx,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='cbbly:') - WParray(j,3)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(cbbly,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,4)=WIDGET_LABEL(WPline(j),VALUE='cbtrx:') - WParray(j,5)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(cbtrx,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,6)=WIDGET_LABEL(WPline(j),VALUE='cbtry:') - WParray(j,7)=WIDGET_TEXT(WPline(j), $ - XSIZE=5,VALUE=STRING(cbtry,FORMAT='(F5.3)'),/EDITABLE) - WParray(j,8)=WIDGET_LABEL(WPline(j),VALUE='Orientation:') - WParray(j,9)=WIDGET_DROPLIST(WPline(j),VALUE=['Portrait','Landscape']) - - i=i+1 - WPbox(i)=WIDGET_BASE(pbase, /FRAME, /COLUMN) - j=j+1 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='Print settings:') - WParray(j,1)=WIDGET_DROPLIST(WPline(j),VALUE=['Portrait','Landscape']) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='font:') - WParray(j,3)=WIDGET_DROPLIST(WPline(j),VALUE=['Helvetica','Times']) - j=8 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_TEXT(WPline(j), $ - VALUE='Print dimensions in cm (Max:'+ $ - strcompress(string(papierx-2*xoffset))+'*'+ $ - strcompress(string(papiery-2*yoffset))+'):') - WParray(j,1)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - VALUE=strcompress(string(pwinx)),YSIZE=1,XSIZE=5) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='*') - WParray(j,3)=WIDGET_TEXT(WPline(j),/EDITABLE,VALUE= $ - strcompress(string(pwiny)),YSIZE=1,XSIZE=5) - j=j+1 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='Font size:') - WParray(j,1)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - VALUE=strcompress(string(facpolice)),YSIZE=1,XSIZE=5) - WParray(j,6)=WIDGET_DROPLIST(WPline(j), $ - VALUE=['Rescale font','no rescale']) - WParray(j,7)=WIDGET_LABEL(WPline(j),VALUE='Base size(pt):') - WParray(j,8)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - VALUE=string(basefontsize,FORMAT='(I2)'),YSIZE=1,XSIZE=2) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='xoffset(cm):') - WParray(j,3)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - VALUE=strcompress(string(xoffset)),YSIZE=1,XSIZE=5) - WParray(j,4)=WIDGET_LABEL(WPline(j),VALUE='yoffset(cm):') - WParray(j,5)=WIDGET_TEXT(WPline(j),/EDITABLE, $ - VALUE=strcompress(string(yoffset)),YSIZE=1,XSIZE=5) - i=i+1 - WPbox(i)=WIDGET_BASE(pbase, /FRAME, /COLUMN) - j=j+1 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_LABEL(WPline(j),VALUE='Frame:') - WParray(j,1)=WIDGET_DROPLIST(WPline(j),VALUE=['X-Y','X,Lon-Y,Lat']) - WParray(j,2)=WIDGET_LABEL(WPline(j),VALUE='x1lab:') - WParray(j,3)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,4)=WIDGET_LABEL(WPline(j),VALUE='x2lab:') - WParray(j,5)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,6)=WIDGET_LABEL(WPline(j),VALUE='y1lab:') - WParray(j,7)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - WParray(j,8)=WIDGET_LABEL(WPline(j),VALUE='y2lab:') - WParray(j,9)=WIDGET_DROPLIST(WPline(j),VALUE=['YES','NO']) - - - - j=11 - WPline(j)=WIDGET_BASE(WPbox(i), /ROW) - WParray(j,0)=WIDGET_BUTTON(pbase, VALUE='CLOSE') - - WIDGET_CONTROL, /REALIZE, pbase - XMANAGER, 'PARAMETER', pbase - subwin(0)=1 -RETURN -END - - -;----------------------------------------------------------------------------- -PRO parameter_event, ev -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON THREED, Ax3D,Az3D,smoothing -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON WPARAM,WParray,root,WParam5,WParam6 -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON WW3, ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri -COMMON OVERLAY2,adbathydot,adcontour -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON FREQ, freq,nfband,findex,findex2 -COMMON DIR, nabin,nabint,aindex,THETA -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON HScalc,Hsc -;*******END OF COMMON BLOCKS******************************* - - type = TAG_NAMES(ev, /STRUCTURE) - CASE type OF - 'WIDGET_BUTTON': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'CLOSE': BEGIN - WIDGET_CONTROL, /DESTROY, ev.top - RETURN - END - 'Font': BEGIN - font=XFONT(GROUP=ev.top,/PRESERVE) - print,font - WIDGET_CONTROL, GET_VALUE=drawval, Wdraw - WSET, drawval - END - ENDCASE - END - - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - print,ev.id - CASE ev.id OF - WParray(0,1): numlevels=FIX(value(0)) - WParray(2,4): smoothing=FIX(value(0)) - WParray(2,6): nbins=FIX(value(0)) - WParray(4,4): cbnticks=FIX(value(0)) - WParray(8,1): pwinx=FLOAT(value(0)) - WParray(8,3): pwiny=FLOAT(value(0)) - WParray(9,1): facpolice=FLOAT(value(0)) - WParray(9,8): basefontsize=FIX(value(0)) - WParray(9,3): xoffset=FLOAT(value(0)) - WParray(9,5): yoffset=FLOAT(value(0)) - WParray(5,1): blx=FLOAT(value(0)) - WParray(5,3): bly=FLOAT(value(0)) - WParray(5,5): trx=FLOAT(value(0)) - WParray(5,7): try=FLOAT(value(0)) - WParray(5,9): textx=FLOAT(value(0)) - WParray(5,11): texty=FLOAT(value(0)) - WParray(5,13): textdx=FLOAT(value(0)) - WParray(5,15): textdy=FLOAT(value(0)) - WParray(6,1): cbblx=FLOAT(value(0)) - WParray(6,3): cbbly=FLOAT(value(0)) - WParray(6,5): cbtrx=FLOAT(value(0)) - WParray(6,7): cbtry=FLOAT(value(0)) - ENDCASE - END - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WParray(0,2): c_repart=ev.index - WParray(0,3): adcontour=ev.index - WParray(1,0): logplot=ev.index - WParray(1,1): fixrange=ev.index - WParray(1,2): filloutofrange=1-ev.index - WParray(3,1): outtit=1-ev.index - WParray(3,3): outxtit=1-ev.index - WParray(3,5): outytit=1-ev.index - WParray(3,7): outcbtit=1-ev.index - WParray(4,1): cbar=1-ev.index - WParray(4,2): cbexrange=1-ev.index - WParray(6,9): axis_orient=ev.index - WParray(7,1): psor=ev.index - WParray(7,3): psfont=ev.index - WParray(9,6):fontrescale=1-ev.index - WParray(10,1): frametype=ev.index - WParray(10,3): outx1lab=1-ev.index - WParray(10,5): outx2lab=1-ev.index - WParray(10,7): outy1lab=1-ev.index - WParray(10,9): outy2lab=1-ev.index - ENDCASE - print,'TS:', ts_filetype - END - 'WIDGET_SLIDER': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - WParray(2,1): Ax3D=FLOAT(value) - WParray(2,2): Az3D=FLOAT(value) - ENDCASE - END - ENDCASE -RETURN -END - - diff --git a/model/aux/idl_twist/rayp.f90 b/model/aux/idl_twist/rayp.f90 deleted file mode 100755 index 6d9f89916..000000000 --- a/model/aux/idl_twist/rayp.f90 +++ /dev/null @@ -1,545 +0,0 @@ -!********************************************************************* -MODULE RKPARAM !parameters for Runge Kutta solver - REAL,DIMENSION(3) :: yscal - REAL h1,hmin,eps - REAL co,freq,dl - INTEGER,PARAMETER :: ndim=3 -END MODULE RKPARAM -!********************************************************************* -MODULE BATHYGRID !bottom topography grid - REAL rlonmax,rlonmin,rlatmin,rlatmax,rot - INTEGER nx,ny,ip,jp - REAL sx,sy,deltaz - REAL(kind=4) ,DIMENSION(:,:),ALLOCATABLE :: grid - REAL ,DIMENSION(1,6) :: einter - REAL ,DIMENSION(1,12) :: dinter -END MODULE BATHYGRID -!********************************************************************* -MODULE Raytraj !bottom topography grid - real xch(500),ych(500),ach(500) - INTEGER nchunk - REAL timestep,depthmin,depthmax -END MODULE Raytraj -!********************************************************************* -MODULE Constants - REAL, PARAMETER :: pi = 3.14159265,tpi=6.2831853,d2r=.01745329 - REAL, PARAMETER :: max15bit=32768.,max8bit=256.,max7bit=128. - REAL, PARAMETER :: max14bit=16384. - INTEGER, PARAMETER :: i15bit=32768,i8bit=256,i7bit=128,i14bit=16384 - REAL, PARAMETER :: g = 9.81 !gravity : SI (m/s^2) - REAL, PARAMETER :: rhow = 1026. !water density : SI (kg/m^3) - REAL, PARAMETER :: kappa = 0.4 !Von Karman's constant - REAL, PARAMETER :: nu = 3.E-6 !Salt water kinematic viscosity - REAL, DIMENSION(:),ALLOCATABLE ::invxtanhx - INTEGER ntanh -END MODULE Constants - -!********************************************************************** -SUBROUTINE tfact(depth,f,fact,fact2) -!... calculates the transformation factor (dk/dko)*(cgo/cg) -!... to avoid floating point exception in sinh, max value of sig=75 -!... first get wave no. and group velocity at transformation site - IMPLICIT NONE - REAL, INTENT(in) ::depth,f - REAL, INTENT(out) ::fact,fact2 - REAL d,dk,c,cg,dk0,c0,cg0 - - CALL disp(depth,f,dk,c,cg) - d=800. - CALL disp(d,f,dk0,c0,cg0) - fact=(dk/dk0)*(cg0/cg) - fact2=(dk/cg) - RETURN -END - - -!********************************************************************* -SUBROUTINE ref(xs,ys,as,iflag) -!********************************************************************* -! This routine integrates the ray equations (using the Cash-Karp Runge-Kutta -! driver RKdriver, from the initial position (xs,ys) until it crosses into a -! different zone. The subroutine returns the position and direction of the -! ray at the zone boundary. -! -! If the Fsource flag is equal to 1 then the routine also computes linear interpolation -! coefficents from the grid points. These coefficients are weighted by the propagation time. -! In order to do that the routine keeps track of the current timestep, -! direction bin and triangle. If any of these change then a new set of -! interpolation coefficients is generated. If not, the coefficients are updated -! and are given more weight. This is checked at every mini-timestep (h1) of the -! RKdriver. -! -! When the zone boundary is reached, coefficents are genrated in order -! to be able to interpolate energy density from the neighboring grid -! points at the end of the ray. -!********************************************************************* - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL,INTENT(inout) :: xs,ys,as !start position (grid units) and angle (rad) - INTEGER,INTENT(out) :: iflag !IFlag=0 hit land or cross-shelf boundary, - - REAL x1,x2,tchunk,dt1 - REAL yrad(3) ! current x,y, and angle - INTEGER kchunk,nstep - - !WRITE(6,*) 'xs ....',xs,ys,as,iflag - yrad(1)=xs - yrad(2)=ys - yrad(3)=as - - tchunk=0. - IFlag=2 - nchunk=0 - -! Starts first chunk - CALL RKdriver(yrad) !take a step - dt1=h1/(60.) !time = time step * (C / Cg) - tchunk=dt1 - kchunk=1 - - DO nstep=1,100000 - CALL RKdriver(yrad) !take a step - tchunk=tchunk+dt1 - - - IF (tchunk.GT.timestep) THEN !timestep change - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - tchunk=tchunk-timestep - ENDIF - - IF (yrad(1).lt.20.or.yrad(1).gt.nx-20) IFlag=0 - IF (yrad(2).lt.20.or.yrad(2).gt.ny-20) IFlag=0 - IF (dl.gt.depthmax) IFlag=1 - IF (dl.lt.depthmin) IFlag=0 - IF (iflag.eq.0.or.iflag.eq.1) THEN - !WRITE(6,*) dl,depthmin,nchunk*timestep+tchunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - RETURN - ENDIF - ENDDO !end of do loop on nstep - print *,' error - too many steps ' - !stop - RETURN - end - - -!********************************************************************** -SUBROUTINE RKdriver(ystart) -! Integrates the 3 starting variables from 0 to h1 -! with accuracy eps. h1 is a guess of the step size, hmin is the -! min step size (0 is ok) ystart is overwritten with the desired -! answer -! yscal is a vector containing the typical scales of each variable -! these scales define the admissible errors: eps*yscal(i) -!********************************************************************** -! The Cash-Karp Runge Kutta solver is adapted to this specific problem -! by Fabrice Ardhuin, june 1999, from Numerical Recipes, 2nd ed. -!********************************************************************** - USE RKPARAM - USE Constants - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::ystart - INTEGER,PARAMETER ::maxstp=1000 - REAL,DIMENSION(ndim) :: y,dydt - REAL x,h,hdid,hnext - INTEGER nstp - - x=0. - h=h1 - y(:)=ystart(:) - DO nstp=1,maxstp - !WRITE(6,*) 'RK driver',nstp,y(1),y(2),y(3),h - CALL derivs(y,dydt) - IF(x+h.gt.h1) h=h1-x !limits step if it goes over the remaining - !time h1-x - CALL rkqs(y,dydt,h,hdid,hnext) - x=x+hdid - IF(x.ge.h1) THEN - ystart(:)=y(:) - !WRITE(6,*) 'RKdriver',x,hdid,h1,nstp,dl - !WRITE(6,*) 'ycurr',ystart - RETURN - ENDIF - h=hnext - ENDDO - WRITE(6,*) 'Step size too smal in RK driver',nstp,x,h1,hdid - STOP - RETURN -END - -!********************************************************************** -SUBROUTINE derivs(y,dydt) -! c=phase speed and dydt are the derivatives of the n vectors -! with respect to time. -!********************************************************************** - USE RKPARAM - USE BATHYGRID - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y - REAL,DIMENSION(ndim),INTENT(out)::dydt - - REAL xg,yg,cg,depth,dcdx,dcdy,ca,sa - - xg=y(1) - yg=y(2) - CALL speed(xg,yg,cg,depth,dcdx,dcdy) - ca=cos(y(3)) - sa=sin(y(3)) - dydt(1)=cg*ca/sx ! x and y are the coordinates in grid units - dydt(2)=cg*sa/sy - dydt(3)=cg*(sa*dcdx/sx-ca*dcdy/sy) - RETURN -END - -!********************************************************************** -SUBROUTINE rkqs(y,dydt,htry,hdid,hnext) -! Fifth order R-K step with monitoring of local error. Input -! is the n-vector of the input variable y and its derivatives -! dydt at the starting value of x. htry is the stepsize to be -! attempted, eps is the required accuracy and yscal is a -! vector against which error is scaled. On output, y and x -! are replaced by their new values,hid is the accomplished -! stepsize and hnext is the estimate of the next stepsize. -!********************************************************************** - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::y,dydt - REAL, INTENT(in) ::htry - REAL, INTENT(out) ::hdid,hnext - - REAL,PARAMETER :: pgrow=-.2 - REAL,PARAMETER :: pshrink=-.25 - REAL,PARAMETER :: safety=.9 - REAL,PARAMETER :: errcon=1.89e-4 !errcon=(5/safety)**(1/pgrow) - REAL,DIMENSION(3):: yerr,ytemp - REAL h,htemp,errmax - INTEGER i,kount - kount=0 - - h=htry - DO - kount=kount+1 - CALL rkck(y,dydt,h,ytemp,yerr) - errmax=0. - DO i=1,ndim - errmax=MAX(errmax,abs(yerr(i)/yscal(i))) - ENDDO - errmax=errmax/eps - !WRITE(6,*) 'RKQS',errmax,kount,h - IF(errmax.GT.1) THEN - htemp=safety*h*(errmax**pshrink) - h=MAX(htemp,0.1*h) !h should always be positive !! - !I got rid of the test on xnew=x - ELSE - IF(errmax.gt.errcon) THEN - hnext=safety*h*(errmax**pgrow) - ELSE - hnext=5.0*h - ENDIF - hdid=h - y(:)=ytemp(:) - RETURN - ENDIF - ENDDO - !WRITE(6,*) 'Step size too smal in rkqs' - RETURN -END - -!********************************************************************** -SUBROUTINE rkck(y,dydt,h,yout,yerr) -! For ndim variables y and their derivs dydt known at y, use -! to advance solution over an interval h and return the -! incremented variables as yout ( which may be the same as y) -! the SUBROUTINE derivs(y,dydt) returns dydt at y - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y,dydt - REAL, INTENT(in) ::h - REAL,DIMENSION(ndim),INTENT(out) ::yout,yerr - - REAL,DIMENSION(ndim) :: ak2,ak3,ak4,ak5,ak6,ytemp - REAL,PARAMETER :: A2=.2,A3=.3,A4=.6,A5=1.,A6=.875 - REAL,PARAMETER :: B21=.2,B31=.075,B32=9./40. - REAL,PARAMETER :: B41=.3,B42=-.9,B43=1.2 - REAL,PARAMETER :: B51=-11./54.,B52=2.5,B53=-70/27.,B54=35./27. - REAL,PARAMETER :: B61=1631./55296.,B62=175./512.,B63=575./13824. - REAL,PARAMETER :: B64=44275./110592.,B65=253./4096. - REAL,PARAMETER :: C1=37./378.,C3=250./621.,C4=125./594.,C6=512./1771. - REAL,PARAMETER :: DC1=C1-2825./27648.,DC3=C3-18575./48384. - REAL,PARAMETER :: DC4=C4-13525/55296.,DC5=-277/14336,DC6=C6-.25 - - ytemp(:)=y(:)+B21*h*dydt(:) - CALL derivs(ytemp,ak2) - ytemp(:)=y(:)+h*(B31*dydt(:)+B32*ak2(:)) - CALL derivs(ytemp,ak3) - ytemp(:)=y(:)+h*(B41*dydt(:)+B42*ak2(:)+B43*ak3(:)) - CALL derivs(ytemp,ak4) - ytemp(:)=y(:)+h*(B51*dydt(:)+B52*ak2(:)+B53*ak3(:)+B54*ak4(:)) - CALL derivs(ytemp,ak5) - ytemp(:)=y(:)+h*(B61*dydt(:)+B62*ak2(:)+B63*ak3(:)+B64*ak4(:)+B65*ak5(:)) - CALL derivs(ytemp,ak6) - yout(:)=y(:)+h*(C1*dydt(:)+C3*ak3(:)+C4*ak4(:)+C6*ak6(:)) - yerr(:)=h*(DC1*dydt(:)+DC3*ak3(:)+DC4*ak4(:)+DC6*ak6(:)) - RETURN -END - -!********************************************************************** -SUBROUTINE speed(xg,yg,cg,depth,dcdx,dcdy) -!********************************************************************** -! Wave speed gradients, from Dobson (1967), for not-too-shallow water -! Code by William C. O'Reilly (1990-1998) -! Modified by Fabrice Ardhuin (1999) to accomodate any depth. -! Modified .................. 11/8/2000 with a Newton-Rapson method for -! the inversion of the dispersion relation -!********************************************************************** -! uses biquadric interpolation (bilinear would not be smooth) -!... calculates the depth, wave phase speed and gradients -! Positions of the grid points (+) used in the computations -! The current point xg,yg (*) is located in the [1,2,3,4] rectangle -! + 8 + 7 -! -! + 9 + 4 + 3 + 6 -! * -! + 10 + 1 + 2 + 5 -! -! + 11 + 12 -!********************************************************************** - USE BATHYGRID - USE Constants - USE RKparam - IMPLICIT NONE - REAL, INTENT(in) ::xg,yg - REAL, INTENT(out) ::cg,depth,dcdx,dcdy - - REAL,DIMENSION(12,6),SAVE :: sxy=reshape((/ 0.30861241,0.23684207,0.21770331, & - 0.23684207,-0.08492823,-0.05143541,-0.05143541,-0.08492823,0.00598086, & - 0.13038277,0.13038277,0.00598086, & - 0.05322964,0.19677030,0.14413872,0.10586122,0.09031100,-0.06758374, & - -0.03349283,0.03349282,-0.18241626,-0.34031099,-0.12440190,0.12440190, & - 0.05322964,0.10586122,0.14413872,0.19677030,0.03349282,-0.03349283, & - -0.06758374,0.09031099,0.12440190,-0.12440191,-0.34031099,-0.18241625, & - -0.125,-0.125,-0.125,-0.125,0.125,0.125, & - 0.,0.,0.125,0.125,-0.,-0., & - 0.05263157,-0.05263157,0.05263158,-0.05263157,-0.15789473,0.15789474, & - 0.15789474,-0.15789473,-0.15789473,0.15789473,0.15789473,-0.15789473, & - -0.125,-0.125,-0.125,-0.125,0.,0., & - 0.125,0.125,-0.,-0.,0.125,0.125 /),(/12,6/)) - - - INTEGER i,j - REAL X,Y,sigma,dy,k,c - REAL xp,yp,sig,aka,yhat,t,a,dddx,dddy,dcdd - - i=INT(xg) - j=INT(yg) - xp=mod(xg,1.0) - yp=mod(yg,1.0) - IF(ip.ne.i.OR.jp.NE.j) THEN - ip=i - jp=j - dinter(1,11)=grid(i,j-1) - dinter(1,12)=grid(i+1,j-1) - dinter(1,10)=grid(i-1,j) - dinter(1,1)=grid(i,j) - dinter(1,2)=grid(i+1,j) - dinter(1,5)=grid(i+2,j) - dinter(1,9)=grid(i-1,j+1) - dinter(1,4)=grid(i,j+1) - dinter(1,3)=grid(i+1,j+1) - dinter(1,6)=grid(i+2,j+1) - dinter(1,8)=grid(i,j+2) - dinter(1,7)=grid(i+1,j+2) - einter=MATMUL(dinter,sxy) - ENDIF - depth=einter(1,1)+(einter(1,2)+einter(1,4)*xp+einter(1,5)*yp)*xp & - +(einter(1,3)+einter(1,6)*yp)*yp - -!... adjust water level here - depth=depth+deltaz - - IF(depth.lt.1.) depth=1. - dl=depth -!... gradients of bottom depths - dddx=einter(1,4)*2.*xp+einter(1,5)*yp+einter(1,2) - dddy=einter(1,6)*2.*yp+einter(1,5)*xp+einter(1,3) -!... calculate phase speed gradient with depth -!... (accurate in Shallow Water where Dobson was not) - sigma=freq*tpi - Y=(sigma**2*DEPTH)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=(invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy) - ENDIF - k=X/DEPTH - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - !dk=aka/depth - !cg=tpi*freq/dk - !rc=c/co - ! old formula: Dobson - !dcdd=sig*(1.-rc*rc)/(c*rc+sig*depth*(1-rc*rc)) - ! the following formula is exaclty equivalent to Dobson in deep water - ! but it is accurate in shallow water - dcdd=(1-y/(y+x**2-y**2))/depth !=(dc/dh)/c - dcdx=dcdd*dddx - dcdy=dcdd*dddy - !WRITE(6,*) 'SPEED',X,Y,I1,xinvxtanh(I1+1),k,c - !WRITE(6,*) 'SPEED',xg,yg,cg,depth,dcdx,dcdy - RETURN - END - -!********************************************************************* - SUBROUTINE DISP(depth,freq,k,c,cg) -!********************************************************************* - USE Constants - IMPLICIT NONE - REAL, INTENT(in) ::depth,freq !depth (m) and frequency (Hz) - REAL, INTENT(out) ::k,c,cg !wave number (m-1),phase speed (m/s) - REAL dep,sigma,X,Y,dy - INTEGER I - - dep=depth - IF (depth.LT.1) dep=1. - sigma=freq*tpi - Y=(sigma**2*DEP)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy - ENDIF - k=X/DEP - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - - RETURN - END - - -!********************************************************************* - SUBROUTINE TABULATE -!********************************************************************* - USE Constants - USE RKPARAM - IMPLICIT NONE - - REAL X,Y,H,F,FD - INTEGER I,J - ntanh=10000 - ALLOCATE(invxtanhx(0:ntanh)) - DO J=0,ntanh - Y=15.*REAL(J)/ntanh - X=Y - F=1. - DO 10 I=1,100 - H=TANH(X) - F=Y-X*H - IF (ABS(F) .LT. 1.E-6) GO TO 20 - FD=-H-X/COSH(X)**2 - X=X-F/FD -10 CONTINUE - PRINT *,' SUBROUTINE DISP DOES NOT CONVERGE !!! ' -20 invxtanhx(J)=X - ENDDO - RETURN - END - -!********************************************************************** -!********************************************************************** -!********************************************************************** -!********************************************************************** -PROGRAM rayplot - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL dtheta,theta0,xs,ys,sig,dw,dk,c,cg,dto,h_len2 - REAL h_len,dxy,dcdx,dcdy,a_step,ang,angs - INTEGER I,J,nrays,Iray,k,ircode - CHARACTER(len=50):: fblog,fbathy - - CALL Tabulate - - - OPEN(3,file='Ray3a.inpray',status='old') - READ(3,'(a)') fblog - READ(3,'(a)') fbathy - READ(3,*) nrays - READ(3,*) freq,dtheta,theta0,timestep,depthmax,depthmin - READ(3,*) deltaz - READ(3,*) xs,ys - CLOSE(3) - - h_len=200 - - eps=0.0001 ! error tolerance in ray integration - -!------------------------------------------------------------------- -! Get bathymetry grid data -!------------------------------------------------------------------- - open(2,file=fblog) - read(2,*) rlonmax,rlonmin,rlatmin,rlatmax - read(2,*) rot - read(2,*) sx,sy - read(2,*) nx,ny - close(2) - yscal(1)=REAL(nx) - yscal(2)=REAL(ny) - yscal(3)=1. - -! Get the grid itself - ALLOCATE(grid(nx,ny)) - open(2,file=fbathy,form='unformatted',access='direct',recl=4*ny) - DO i=1,nx !beware 1 should be replaced by 4 on HP terminals - read(2,rec=i) (grid(i,j),j=1,ny) - ENDDO - CLOSE(2) - - sig=2.*pi*freq - - dw=800. - call disp(dw,freq,dk,c,cg) !calculate deep water phase speed - dto=timestep*60. - h_len2=cg*dto*0.1 !lengthen the steps for long output timestep - IF (h_len2 > h_len) h_len=h_len2 - - co=c - hmin=0. - h1=h_len/co !calculate initial ray time steps, h1 - ! (major factor in computation time) - CALL speed(xs,ys,c,dxy,dcdx,dcdy) - !WRITE(6,*) 'speed',xs,ys,c,dcdx,dcdy - a_step=dtheta - !OPEN(995,file='rays.bin',status='unknown',form='unformatted') - OPEN(995,file='rays.asc',status='unknown') - ang=theta0-a_step - DO IRAY=1,nrays - ang=ang+a_step - angs=ang*d2r !transforms to radians - CALL ref(xs,ys,angs,ircode) - !WRITE(6,*) 'ray:',IRAY,ang,ircode - ! write(995) nchunk,ircode - ! write(995) (xch(k),k=1,nchunk), & - ! (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - write(995,*) nchunk,ircode - write(995,*) (xch(k),k=1,nchunk), & - (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - ENDDO - CLOSE(995) - END diff --git a/model/aux/idl_twist/raypf.f90 b/model/aux/idl_twist/raypf.f90 deleted file mode 100755 index b42c66169..000000000 --- a/model/aux/idl_twist/raypf.f90 +++ /dev/null @@ -1,604 +0,0 @@ -!********************************************************************* -MODULE RKPARAM !parameters for Runge Kutta solver - REAL,DIMENSION(3) :: yscal - REAL h1,hmin,eps - REAL co,freq,dl - INTEGER,PARAMETER :: ndim=3 -END MODULE RKPARAM -!********************************************************************* -MODULE BATHYGRID !bottom topography grid - REAL rlonmax,rlonmin,rlatmin,rlatmax,rot - INTEGER nx,ny,ip,jp - REAL sx,sy,deltaz - REAL(kind=4) ,DIMENSION(:,:),ALLOCATABLE :: grid - REAL ,DIMENSION(1,6) :: einter - REAL ,DIMENSION(1,12) :: dinter -END MODULE BATHYGRID -!********************************************************************* -MODULE Raytraj !bottom topography grid - real xch(500),ych(500),ach(500) - INTEGER nchunk - REAL timestep,depthmin,depthmax -END MODULE Raytraj -!********************************************************************* -MODULE Constants - REAL, PARAMETER :: pi = 3.14159265,tpi=6.2831853,d2r=.01745329 - REAL, PARAMETER :: max15bit=32768.,max8bit=256.,max7bit=128. - REAL, PARAMETER :: max14bit=16384. - INTEGER, PARAMETER :: i15bit=32768,i8bit=256,i7bit=128,i14bit=16384 - REAL, PARAMETER :: g = 9.81 !gravity : SI (m/s^2) - REAL, PARAMETER :: rhow = 1026. !water density : SI (kg/m^3) - REAL, PARAMETER :: kappa = 0.4 !Von Karman's constant - REAL, PARAMETER :: nu = 3.E-6 !Salt water kinematic viscosity - REAL, DIMENSION(:),ALLOCATABLE ::invxtanhx - INTEGER ntanh -END MODULE Constants - -!********************************************************************** -SUBROUTINE tfact(depth,f,fact,fact2) -!... calculates the transformation factor (dk/dko)*(cgo/cg) -!... to avoid floating point exception in sinh, max value of sig=75 -!... first get wave no. and group velocity at transformation site - IMPLICIT NONE - REAL, INTENT(in) ::depth,f - REAL, INTENT(out) ::fact,fact2 - REAL d,dk,c,cg,dk0,c0,cg0 - - CALL disp(depth,f,dk,c,cg) - d=800. - CALL disp(d,f,dk0,c0,cg0) - fact=(dk/dk0)*(cg0/cg) - fact2=(dk/cg) - RETURN -END - - -!********************************************************************* -SUBROUTINE ref(xs,ys,as,iflag) -!********************************************************************* -! This routine integrates the ray equations (using the Cash-Karp Runge-Kutta -! driver RKdriver, from the initial position (xs,ys) until it crosses into a -! different zone. The subroutine returns the position and direction of the -! ray at the zone boundary. -! -! If the Fsource flag is equal to 1 then the routine also computes linear interpolation -! coefficents from the grid points. These coefficients are weighted by the propagation time. -! In order to do that the routine keeps track of the current timestep, -! direction bin and triangle. If any of these change then a new set of -! interpolation coefficients is generated. If not, the coefficients are updated -! and are given more weight. This is checked at every mini-timestep (h1) of the -! RKdriver. -! -! When the zone boundary is reached, coefficents are genrated in order -! to be able to interpolate energy density from the neighboring grid -! points at the end of the ray. -!********************************************************************* - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL,INTENT(inout) :: xs,ys,as !start position (grid units) and angle (rad) - INTEGER,INTENT(out) :: iflag !IFlag=0 hit land or cross-shelf boundary, - - REAL x1,x2,tchunk,dt1 - REAL yrad(3) ! current x,y, and angle - INTEGER kchunk,nstep - - !WRITE(6,*) 'xs ....',xs,ys,as,iflag - yrad(1)=xs - yrad(2)=ys - yrad(3)=as - - tchunk=0. - IFlag=2 - nchunk=0 - -! Starts first chunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - - CALL RKdriver(yrad) !take a step - dt1=h1/(60.) !time = time step * (C / Cg) - tchunk=dt1 - kchunk=1 - - DO nstep=1,100000 - CALL RKdriver(yrad) !take a step - tchunk=tchunk+dt1 - !WRITE(6,*) 'STEP:',nstep,yrad(1),yrad(2),yrad(3) - - IF (tchunk.GT.timestep) THEN !timestep change - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - tchunk=tchunk-timestep - ENDIF - - IF (yrad(1).lt.10.or.yrad(1).gt.nx-10) IFlag=0 - IF (yrad(2).lt.10.or.yrad(2).gt.ny-10) IFlag=0 - IF (dl.gt.depthmax) IFlag=1 - IF (dl.lt.depthmin) IFlag=0 - IF (iflag.eq.0.or.iflag.eq.1) THEN - ! WRITE(6,*) 'FLAGG:',dl,depthmin,nchunk*timestep+tchunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - RETURN - ENDIF - ENDDO !end of do loop on nstep - print *,' error - too many steps ' - !stop - RETURN - end - - -!********************************************************************** -SUBROUTINE RKdriver(ystart) -! Integrates the 3 starting variables from 0 to h1 -! with accuracy eps. h1 is a guess of the step size, hmin is the -! min step size (0 is ok) ystart is overwritten with the desired -! answer -! yscal is a vector containing the typical scales of each variable -! these scales define the admissible errors: eps*yscal(i) -!********************************************************************** -! The Cash-Karp Runge Kutta solver is adapted to this specific problem -! by Fabrice Ardhuin, june 1999, from Numerical Recipes, 2nd ed. -!********************************************************************** - USE RKPARAM - USE Constants - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::ystart - INTEGER,PARAMETER ::maxstp=1000 - REAL,DIMENSION(ndim) :: y,dydt - REAL x,h,hdid,hnext - INTEGER nstp - - x=0. - h=h1 - y(:)=ystart(:) - DO nstp=1,maxstp - !WRITE(6,*) 'RK driver',nstp,y(1),y(2),y(3),h - CALL derivs(y,dydt) - IF(x+h.gt.h1) h=h1-x !limits step if it goes over the remaining - !time h1-x - CALL rkqs(y,dydt,h,hdid,hnext) - x=x+hdid - IF(x.ge.h1) THEN - ystart(:)=y(:) - !WRITE(6,*) 'RKdriver',x,hdid,h1,nstp,dl - !WRITE(6,*) 'ycurr',ystart - RETURN - ENDIF - h=hnext - ENDDO - WRITE(6,*) 'Step size too smal in RK driver',nstp,x,h1,hdid - STOP - RETURN -END - -!********************************************************************** -SUBROUTINE derivs(y,dydt) -! c=phase speed and dydt are the derivatives of the n vectors -! with respect to time. -!********************************************************************** - USE RKPARAM - USE BATHYGRID - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y - REAL,DIMENSION(ndim),INTENT(out)::dydt - - REAL xg,yg,cg,depth,dcdx,dcdy,ca,sa - - xg=y(1) - yg=y(2) - CALL speed(xg,yg,cg,depth,dcdx,dcdy) - ca=cos(y(3)) - sa=sin(y(3)) - dydt(1)=cg*ca/sx ! x and y are the coordinates in grid units - dydt(2)=cg*sa/sy - dydt(3)=cg*(sa*dcdx/sx-ca*dcdy/sy) - RETURN -END - -!********************************************************************** -SUBROUTINE rkqs(y,dydt,htry,hdid,hnext) -! Fifth order R-K step with monitoring of local error. Input -! is the n-vector of the input variable y and its derivatives -! dydt at the starting value of x. htry is the stepsize to be -! attempted, eps is the required accuracy and yscal is a -! vector against which error is scaled. On output, y and x -! are replaced by their new values,hid is the accomplished -! stepsize and hnext is the estimate of the next stepsize. -!********************************************************************** - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::y,dydt - REAL, INTENT(in) ::htry - REAL, INTENT(out) ::hdid,hnext - - REAL,PARAMETER :: pgrow=-.2 - REAL,PARAMETER :: pshrink=-.25 - REAL,PARAMETER :: safety=.9 - REAL,PARAMETER :: errcon=1.89e-4 !errcon=(5/safety)**(1/pgrow) - REAL,DIMENSION(3):: yerr,ytemp - REAL h,htemp,errmax - INTEGER i,kount - kount=0 - - h=htry - DO - kount=kount+1 - CALL rkck(y,dydt,h,ytemp,yerr) - errmax=0. - DO i=1,ndim - errmax=MAX(errmax,abs(yerr(i)/yscal(i))) - ENDDO - errmax=errmax/eps - !WRITE(6,*) 'RKQS',errmax,kount,h - IF(errmax.GT.1) THEN - htemp=safety*h*(errmax**pshrink) - h=MAX(htemp,0.1*h) !h should always be positive !! - !I got rid of the test on xnew=x - ELSE - IF(errmax.gt.errcon) THEN - hnext=safety*h*(errmax**pgrow) - ELSE - hnext=5.0*h - ENDIF - hdid=h - y(:)=ytemp(:) - RETURN - ENDIF - ENDDO - !WRITE(6,*) 'Step size too smal in rkqs' - RETURN -END - -!********************************************************************** -SUBROUTINE rkck(y,dydt,h,yout,yerr) -! For ndim variables y and their derivs dydt known at y, use -! to advance solution over an interval h and return the -! incremented variables as yout ( which may be the same as y) -! the SUBROUTINE derivs(y,dydt) returns dydt at y - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y,dydt - REAL, INTENT(in) ::h - REAL,DIMENSION(ndim),INTENT(out) ::yout,yerr - - REAL,DIMENSION(ndim) :: ak2,ak3,ak4,ak5,ak6,ytemp - REAL,PARAMETER :: A2=.2,A3=.3,A4=.6,A5=1.,A6=.875 - REAL,PARAMETER :: B21=.2,B31=.075,B32=9./40. - REAL,PARAMETER :: B41=.3,B42=-.9,B43=1.2 - REAL,PARAMETER :: B51=-11./54.,B52=2.5,B53=-70/27.,B54=35./27. - REAL,PARAMETER :: B61=1631./55296.,B62=175./512.,B63=575./13824. - REAL,PARAMETER :: B64=44275./110592.,B65=253./4096. - REAL,PARAMETER :: C1=37./378.,C3=250./621.,C4=125./594.,C6=512./1771. - REAL,PARAMETER :: DC1=C1-2825./27648.,DC3=C3-18575./48384. - REAL,PARAMETER :: DC4=C4-13525/55296.,DC5=-277/14336,DC6=C6-.25 - - ytemp(:)=y(:)+B21*h*dydt(:) - CALL derivs(ytemp,ak2) - ytemp(:)=y(:)+h*(B31*dydt(:)+B32*ak2(:)) - CALL derivs(ytemp,ak3) - ytemp(:)=y(:)+h*(B41*dydt(:)+B42*ak2(:)+B43*ak3(:)) - CALL derivs(ytemp,ak4) - ytemp(:)=y(:)+h*(B51*dydt(:)+B52*ak2(:)+B53*ak3(:)+B54*ak4(:)) - CALL derivs(ytemp,ak5) - ytemp(:)=y(:)+h*(B61*dydt(:)+B62*ak2(:)+B63*ak3(:)+B64*ak4(:)+B65*ak5(:)) - CALL derivs(ytemp,ak6) - yout(:)=y(:)+h*(C1*dydt(:)+C3*ak3(:)+C4*ak4(:)+C6*ak6(:)) - yerr(:)=h*(DC1*dydt(:)+DC3*ak3(:)+DC4*ak4(:)+DC6*ak6(:)) - RETURN -END - -!********************************************************************** -SUBROUTINE speed(xg,yg,cg,depth,dcdx,dcdy) -!********************************************************************** -! Wave speed gradients, from Dobson (1967), for not-too-shallow water -! Code by William C. O'Reilly (1990-1998) -! Modified by Fabrice Ardhuin (1999) to accomodate any depth. -! Modified .................. 11/8/2000 with a Newton-Rapson method for -! the inversion of the dispersion relation -!********************************************************************** -! uses biquadric interpolation (bilinear would not be smooth) -!... calculates the depth, wave phase speed and gradients -! Positions of the grid points (+) used in the computations -! The current point xg,yg (*) is located in the [1,2,3,4] rectangle -! + 8 + 7 -! -! + 9 + 4 + 3 + 6 -! * -! + 10 + 1 + 2 + 5 -! -! + 11 + 12 -!********************************************************************** - USE BATHYGRID - USE Constants - USE RKparam - IMPLICIT NONE - REAL, INTENT(in) ::xg,yg - REAL, INTENT(out) ::cg,depth,dcdx,dcdy - - REAL,DIMENSION(12,6),SAVE :: sxy=reshape((/ 0.30861241,0.23684207,0.21770331, & - 0.23684207,-0.08492823,-0.05143541,-0.05143541,-0.08492823,0.00598086, & - 0.13038277,0.13038277,0.00598086, & - 0.05322964,0.19677030,0.14413872,0.10586122,0.09031100,-0.06758374, & - -0.03349283,0.03349282,-0.18241626,-0.34031099,-0.12440190,0.12440190, & - 0.05322964,0.10586122,0.14413872,0.19677030,0.03349282,-0.03349283, & - -0.06758374,0.09031099,0.12440190,-0.12440191,-0.34031099,-0.18241625, & - -0.125,-0.125,-0.125,-0.125,0.125,0.125, & - 0.,0.,0.125,0.125,-0.,-0., & - 0.05263157,-0.05263157,0.05263158,-0.05263157,-0.15789473,0.15789474, & - 0.15789474,-0.15789473,-0.15789473,0.15789473,0.15789473,-0.15789473, & - -0.125,-0.125,-0.125,-0.125,0.,0., & - 0.125,0.125,-0.,-0.,0.125,0.125 /),(/12,6/)) - - - INTEGER i,j - REAL X,Y,sigma,dy,k,c - REAL xp,yp,sig,aka,yhat,t,a,dddx,dddy,dcdd - - i=INT(xg) - j=INT(yg) - xp=mod(xg,1.0) - yp=mod(yg,1.0) - IF(ip.ne.i.OR.jp.NE.j) THEN - ip=i - jp=j - dinter(1,11)=grid(i,j-1) - dinter(1,12)=grid(i+1,j-1) - dinter(1,10)=grid(i-1,j) - dinter(1,1)=grid(i,j) - dinter(1,2)=grid(i+1,j) - dinter(1,5)=grid(i+2,j) - dinter(1,9)=grid(i-1,j+1) - dinter(1,4)=grid(i,j+1) - dinter(1,3)=grid(i+1,j+1) - dinter(1,6)=grid(i+2,j+1) - dinter(1,8)=grid(i,j+2) - dinter(1,7)=grid(i+1,j+2) - einter=MATMUL(dinter,sxy) - ENDIF - depth=einter(1,1)+(einter(1,2)+einter(1,4)*xp+einter(1,5)*yp)*xp & - +(einter(1,3)+einter(1,6)*yp)*yp - -!... adjust water level here - depth=depth+deltaz - - IF(depth.lt.0.3) depth=0.3 - dl=depth -!... gradients of bottom depths - dddx=einter(1,4)*2.*xp+einter(1,5)*yp+einter(1,2) - dddy=einter(1,6)*2.*yp+einter(1,5)*xp+einter(1,3) -!... calculate phase speed gradient with depth -!... (accurate in Shallow Water where Dobson was not) - sigma=freq*tpi - Y=(sigma**2*DEPTH)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=(invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy) - ENDIF - k=X/DEPTH - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - !dk=aka/depth - !cg=tpi*freq/dk - !rc=c/co - ! old formula: Dobson - !dcdd=sig*(1.-rc*rc)/(c*rc+sig*depth*(1-rc*rc)) - ! the following formula is exaclty equivalent to Dobson in deep water - ! but it is accurate in shallow water - dcdd=(1-y/(y+x**2-y**2))/depth !=(dc/dh)/c - dcdx=dcdd*dddx - dcdy=dcdd*dddy - !WRITE(6,*) 'SPEED',X,Y,I1,xinvxtanh(I1+1),k,c - !WRITE(6,*) 'SPEED',xg,yg,cg,depth,dcdx,dcdy - RETURN - END - -!********************************************************************* - SUBROUTINE DISP(depth,freq,k,c,cg) -!********************************************************************* - USE Constants - IMPLICIT NONE - REAL, INTENT(in) ::depth,freq !depth (m) and frequency (Hz) - REAL, INTENT(out) ::k,c,cg !wave number (m-1),phase speed (m/s) - REAL dep,sigma,X,Y,dy - INTEGER I - - dep=depth - IF (depth.LT.1) dep=1. - sigma=freq*tpi - Y=(sigma**2*DEP)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy - ENDIF - k=X/DEP - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - - RETURN - END - - -!********************************************************************* - SUBROUTINE TABULATE -!********************************************************************* - USE Constants - USE RKPARAM - IMPLICIT NONE - - REAL X,Y,H,F,FD - INTEGER I,J - ntanh=10000 - ALLOCATE(invxtanhx(0:ntanh)) - DO J=0,ntanh - Y=15.*REAL(J)/ntanh - X=Y - F=1. - DO 10 I=1,100 - H=TANH(X) - F=Y-X*H - IF (ABS(F) .LT. 1.E-6) GO TO 20 - FD=-H-X/COSH(X)**2 - X=X-F/FD -10 CONTINUE - PRINT *,' SUBROUTINE DISP DOES NOT CONVERGE !!! ' -20 invxtanhx(J)=X - ENDDO - RETURN - END - -!********************************************************************** -!********************************************************************** -!********************************************************************** -!********************************************************************** -PROGRAM rayplot ! Forward ray-tracing version - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL distance,theta0,xs,ys,sig,dw,dk,c,cg,dto,h_len2,delx,dely - REAL h_len,dxy,dcdx,dcdy,a_step,ang,angs - INTEGER I,J,nrays,Iray,k,ircode,Iray1 - CHARACTER(len=160):: fblog,fbathy - - CALL Tabulate - - - OPEN(3,file='Ray3a.inpray',status='old') - READ(3,'(a)') fblog - READ(3,'(a)') fbathy - READ(3,*) nrays - READ(3,*) freq,distance,theta0,timestep,depthmax,depthmin - READ(3,*) deltaz - !READ(3,*) xs,ys - CLOSE(3) - - h_len=100 - - eps=0.0001 ! error tolerance in ray integration - -!------------------------------------------------------------------- -! Get bathymetry grid data -!------------------------------------------------------------------- - open(2,file=fblog) - read(2,*) rlonmax,rlonmin,rlatmin,rlatmax - read(2,*) rot - read(2,*) sx,sy - read(2,*) nx,ny - close(2) - yscal(1)=REAL(nx) - yscal(2)=REAL(ny) - yscal(3)=1. - -! Get the grid itself - ALLOCATE(grid(nx,ny)) - open(2,file=fbathy,form='unformatted',access='direct',recl=4*ny) - DO i=1,nx !beware 1 should be replaced by 4 on HP terminals - read(2,rec=i) (grid(i,j),j=1,ny) - ENDDO - CLOSE(2) - - sig=2.*pi*freq - - dw=800. - call disp(dw,freq,dk,c,cg) !calculate deep water phase speed - dto=timestep*60. - h_len2=cg*dto*0.1 !lengthen the steps for long output timestep - IF (h_len2 > h_len) h_len=h_len2 - - co=c - hmin=0. - !IF (h_len.GT.(sx+sy)*0.25) h_len=(sx+sy)*0.25 - h1=h_len/co !calculate initial ray time steps, h1 - ! (major factor in computation time) - - OPEN(995,file='rays.asc',status='unknown') - WRITE(6,*) 'Ray direction:',theta0 - ang=MOD(theta0,180.) !+180 - if (ang.GT.90) ang=ang-180. - if (ang.LT.-90) ang=ang+180. - WRITE(6,*) 'changed to:',ang,MOD(theta0,180.) - xs=21 - ys=21 - Iray1=0 - angs=ang*d2r !transforms to radians - delx=distance*1000./sx/sin(angs) - dely=distance*1000./sy/cos(angs) - WRITE(6,*) 'DELX,DELY:',distance,delx,dely,xs,ys,ang - IF ((delx.GT.0).AND.(dely.GT.0)) THEN - xs=21 - ys=ny-20 - ENDIF - DO IRAY=1,nrays - !WRITE(6,*) 'ray before:',IRAY,Iray1,xs,ys,ang - CALL ref(xs,ys,angs,ircode) - !WRITE(6,*) 'ray after :',IRAY,Iray1,xs,ys,ang,ircode - write(995,*) nchunk,ircode - write(995,*) (xch(k),k=1,nchunk), & - (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - - IF (delx.LT.0) THEN - IF (ABS(cos(angs)).GT.1E-5.AND.ys.LT.(ny-20)) THEN - ys=ys+dely - ELSE - ys=ny-20 - ENDIF - IF (ys.GT.(ny-20)) THEN - xs=xs+ABS((ys-ny+20)*sy/sx/tan(angs)) - ys=ny-20 - Iray1=Iray - ENDIF - IF (ys.EQ.ny-20.AND.(Iray.NE.Iray1)) THEN - xs=xs-delx - ENDIF - ELSE - IF (dely.GT.0) THEN - IF (ABS(cos(angs)).GT.1E-5.AND.ys.GT.21) THEN - ys=ys-dely - ELSE - ys=21 - ENDIF - IF (ys.LT.(21)) THEN - xs=xs+ABS((21-ys)*tan(angs)*sy/sx) - ys=21 - Iray1=Iray - ENDIF - ELSE - IF (ABS(cos(angs)).GT.1E-5.AND.ys.LT.(ny-20)) THEN - ys=ys-dely - ELSE - ys=ny-20 - ENDIF - - IF (ys.LT.(21)) THEN - xs=xs+ABS((ys-(ny-20))*tan(angs)*sy/sx) - ys=ny-20 - Iray1=Iray - ENDIF - ENDIF - - IF (ys.EQ.21.AND.(Iray.NE.Iray1)) THEN - xs=xs+delx - ENDIF - ENDIF - ENDDO - CLOSE(995) - END diff --git a/model/aux/idl_twist/raypfc.f90 b/model/aux/idl_twist/raypfc.f90 deleted file mode 100644 index 94613a610..000000000 --- a/model/aux/idl_twist/raypfc.f90 +++ /dev/null @@ -1,756 +0,0 @@ -!********************************************************************* -MODULE RKPARAM !parameters for Runge Kutta solver - REAL,DIMENSION(3) :: yscal - REAL h1,hmin,eps - REAL co,freq,dl - INTEGER,PARAMETER :: ndim=3 -END MODULE RKPARAM -!********************************************************************* -MODULE BATHYGRID !bottom topography grid - REAL rlonmax,rlonmin,rlatmin,rlatmax,rot - INTEGER nx,ny,ip,jp - REAL sx,sy,deltaz - REAL(kind=4), TARGET ,DIMENSION(:,:),ALLOCATABLE :: grid, U, V - REAL(kind=4), TARGET ,DIMENSION(1,6) :: gride,Ue, Ve - REAL(kind=4), TARGET ,DIMENSION(1,12) :: gridd,Ud,Vd -END MODULE BATHYGRID -!********************************************************************* -MODULE Raytraj !bottom topography grid - real xch(1500),ych(1500),ach(1500) - INTEGER nchunk - REAL timestep,depthmin,depthmax -END MODULE Raytraj -!********************************************************************* -MODULE Constants - REAL, PARAMETER :: pi = 3.14159265,tpi=6.2831853,d2r=.01745329 - REAL, PARAMETER :: max15bit=32768.,max8bit=256.,max7bit=128. - REAL, PARAMETER :: max14bit=16384. - INTEGER, PARAMETER :: i15bit=32768,i8bit=256,i7bit=128,i14bit=16384 - REAL, PARAMETER :: g = 9.81 !gravity : SI (m/s^2) - REAL, PARAMETER :: rhow = 1026. !water density : SI (kg/m^3) - REAL, PARAMETER :: kappa = 0.4 !Von Karman's constant - REAL, PARAMETER :: nu = 3.E-6 !Salt water kinematic viscosity - REAL, DIMENSION(:),ALLOCATABLE ::invxtanhx - REAL, DIMENSION(:,:),ALLOCATABLE ::invxtanhxc - INTEGER ntanh,ncur -END MODULE Constants - -!********************************************************************** -SUBROUTINE tfact(depth,f,fact,fact2) -!... calculates the transformation factor (dk/dko)*(cgo/cg) -!... to avoid floating point exception in sinh, max value of sig=75 -!... first get wave no. and group velocity at transformation site - IMPLICIT NONE - REAL, INTENT(in) ::depth,f - REAL, INTENT(out) ::fact,fact2 - REAL d,dk,c,cg,dk0,c0,cg0 - - CALL disp(depth,f,dk,c,cg) - d=800. - CALL disp(d,f,dk0,c0,cg0) - fact=(dk/dk0)*(cg0/cg) - fact2=(dk/cg) - RETURN -END - - -!********************************************************************* -SUBROUTINE ref(xs,ys,as,iflag) -!********************************************************************* -! This routine integrates the ray equations (using the Cash-Karp Runge-Kutta -! driver RKdriver, from the initial position (xs,ys) until it crosses into a -! different zone. The subroutine returns the position and direction of the -! ray at the zone boundary. -! -! If the Fsource flag is equal to 1 then the routine also computes linear interpolation -! coefficents from the grid points. These coefficients are weighted by the propagation time. -! In order to do that the routine keeps track of the current timestep, -! direction bin and triangle. If any of these change then a new set of -! interpolation coefficients is generated. If not, the coefficients are updated -! and are given more weight. This is checked at every mini-timestep (h1) of the -! RKdriver. -! -! When the zone boundary is reached, coefficents are genrated in order -! to be able to interpolate energy density from the neighboring grid -! points at the end of the ray. -!********************************************************************* - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL,INTENT(inout) :: xs,ys,as !start position (grid units) and angle (rad) - INTEGER,INTENT(out) :: iflag !IFlag=0 hit land or cross-shelf boundary, - - REAL x1,x2,tchunk,dt1 - REAL yrad(3) ! current x,y, and angle - INTEGER kchunk,nstep - - !WRITE(6,*) 'xs ....',xs,ys,as,iflag - yrad(1)=xs - yrad(2)=ys - yrad(3)=as - - tchunk=0. - IFlag=2 - nchunk=0 - -! Starts first chunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - - CALL RKdriver(yrad) !take a step - dt1=h1/(60.) !time = time step * (C / Cg) - tchunk=dt1 - kchunk=1 - - DO nstep=1,100000 - CALL RKdriver(yrad) !take a step - tchunk=tchunk+dt1 - !WRITE(6,*) 'STEP:',nstep,yrad(1),yrad(2),yrad(3) - - IF (tchunk.GT.timestep) THEN !timestep change - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - tchunk=tchunk-timestep - ENDIF - - IF (yrad(1).lt.10.or.yrad(1).gt.nx-10) IFlag=0 - IF (yrad(2).lt.10.or.yrad(2).gt.ny-10) IFlag=0 - IF (dl.gt.depthmax) IFlag=1 - IF (dl.lt.depthmin) IFlag=0 - IF (iflag.eq.0.or.iflag.eq.1) THEN - ! WRITE(6,*) 'FLAGG:',dl,depthmin,nchunk*timestep+tchunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)*sx/1000. - ych(nchunk)=yrad(2)*sy/1000. - ach(nchunk)=yrad(3)*180/pi - RETURN - ENDIF - ENDDO !end of do loop on nstep - print *,' error - too many steps ' - !stop - RETURN - end - - -!********************************************************************** -SUBROUTINE RKdriver(ystart) -! Integrates the 3 starting variables from 0 to h1 -! with accuracy eps. h1 is a guess of the step size, hmin is the -! min step size (0 is ok) ystart is overwritten with the desired -! answer -! yscal is a vector containing the typical scales of each variable -! these scales define the admissible errors: eps*yscal(i) -!********************************************************************** -! The Cash-Karp Runge Kutta solver is adapted to this specific problem -! by Fabrice Ardhuin, june 1999, from Numerical Recipes, 2nd ed. -!********************************************************************** - USE RKPARAM - USE Constants - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::ystart - INTEGER,PARAMETER ::maxstp=1000 - REAL,DIMENSION(ndim) :: y,dydt - REAL x,h,hdid,hnext - INTEGER nstp - - x=0. - h=h1 - y(:)=ystart(:) - DO nstp=1,maxstp - !WRITE(6,*) 'RK driver',nstp,y(1),y(2),y(3),h - CALL derivs(y,dydt) - IF(x+h.gt.h1) h=h1-x !limits step if it goes over the remaining - !time h1-x - CALL rkqs(y,dydt,h,hdid,hnext) - x=x+hdid - IF(x.ge.h1) THEN - ystart(:)=y(:) - !WRITE(6,*) 'RKdriver',x,hdid,h1,nstp,dl - !WRITE(6,*) 'ycurr',ystart - RETURN - ENDIF - h=hnext - ENDDO - WRITE(6,*) 'Step size too smal in RK driver',nstp,x,h1,hdid - STOP - RETURN -END - -!********************************************************************** -SUBROUTINE derivs(y,dydt) -! c=phase speed and dydt are the derivatives of the n vectors -! with respect to time. -!********************************************************************** - USE RKPARAM - USE BATHYGRID - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y - REAL,DIMENSION(ndim),INTENT(out)::dydt - - REAL xg,yg,cg,depth,dcdx,dcdy,ca,sa,Umean,Vmean, gUx, gUy, gVx, gVy - - xg=y(1) - yg=y(2) - CALL speed(xg,yg,y(3),cg,depth,dcdx,dcdy,Umean,Vmean, gUx, gUy, gVx, gVy) - !WRITE(6,*) 'SPEED:',xg,yg,cg,depth,dcdx,dcdy,Umean,Vmean, gUx, gUy, gVx, gVy - ca=cos(y(3)) - sa=sin(y(3)) - dydt(1)=(cg*ca+Umean)/sx ! x and y are the coordinates in grid units - dydt(2)=(cg*sa+Vmean)/sy - !dydt(3)=cg*(sa*dcdx/sx-ca*dcdy/sy)+sa**2*gVx+sa*ca*(gUx-gVy)-ca**2*gUy - dydt(3)=(sa*(cg*dcdx+sa*gVx+ca*gUx)/sx-ca*(cg*dcdy+ca*gUy+sa*gVy)/sy) - RETURN -END - -!********************************************************************** -SUBROUTINE rkqs(y,dydt,htry,hdid,hnext) -! Fifth order R-K step with monitoring of local error. Input -! is the n-vector of the input variable y and its derivatives -! dydt at the starting value of x. htry is the stepsize to be -! attempted, eps is the required accuracy and yscal is a -! vector against which error is scaled. On output, y and x -! are replaced by their new values,hid is the accomplished -! stepsize and hnext is the estimate of the next stepsize. -!********************************************************************** - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::y,dydt - REAL, INTENT(in) ::htry - REAL, INTENT(out) ::hdid,hnext - - REAL,PARAMETER :: pgrow=-.2 - REAL,PARAMETER :: pshrink=-.25 - REAL,PARAMETER :: safety=.9 - REAL,PARAMETER :: errcon=1.89e-4 !errcon=(5/safety)**(1/pgrow) - REAL,DIMENSION(3):: yerr,ytemp - REAL h,htemp,errmax - INTEGER i,kount - kount=0 - - h=htry - DO - kount=kount+1 - CALL rkck(y,dydt,h,ytemp,yerr) - errmax=0. - DO i=1,ndim - errmax=MAX(errmax,abs(yerr(i)/yscal(i))) - ENDDO - errmax=errmax/eps - !WRITE(6,*) 'RKQS',errmax,kount,h - IF(errmax.GT.1) THEN - htemp=safety*h*(errmax**pshrink) - h=MAX(htemp,0.1*h) !h should always be positive !! - !I got rid of the test on xnew=x - ELSE - IF(errmax.gt.errcon) THEN - hnext=safety*h*(errmax**pgrow) - ELSE - hnext=5.0*h - ENDIF - hdid=h - y(:)=ytemp(:) - RETURN - ENDIF - ENDDO - !WRITE(6,*) 'Step size too smal in rkqs' - RETURN -END - -!********************************************************************** -SUBROUTINE rkck(y,dydt,h,yout,yerr) -! For ndim variables y and their derivs dydt known at y, use -! to advance solution over an interval h and return the -! incremented variables as yout ( which may be the same as y) -! the SUBROUTINE derivs(y,dydt) returns dydt at y - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y,dydt - REAL, INTENT(in) ::h - REAL,DIMENSION(ndim),INTENT(out) ::yout,yerr - - REAL,DIMENSION(ndim) :: ak2,ak3,ak4,ak5,ak6,ytemp - REAL,PARAMETER :: A2=.2,A3=.3,A4=.6,A5=1.,A6=.875 - REAL,PARAMETER :: B21=.2,B31=.075,B32=9./40. - REAL,PARAMETER :: B41=.3,B42=-.9,B43=1.2 - REAL,PARAMETER :: B51=-11./54.,B52=2.5,B53=-70/27.,B54=35./27. - REAL,PARAMETER :: B61=1631./55296.,B62=175./512.,B63=575./13824. - REAL,PARAMETER :: B64=44275./110592.,B65=253./4096. - REAL,PARAMETER :: C1=37./378.,C3=250./621.,C4=125./594.,C6=512./1771. - REAL,PARAMETER :: DC1=C1-2825./27648.,DC3=C3-18575./48384. - REAL,PARAMETER :: DC4=C4-13525/55296.,DC5=-277/14336,DC6=C6-.25 - - ytemp(:)=y(:)+B21*h*dydt(:) - CALL derivs(ytemp,ak2) - ytemp(:)=y(:)+h*(B31*dydt(:)+B32*ak2(:)) - CALL derivs(ytemp,ak3) - ytemp(:)=y(:)+h*(B41*dydt(:)+B42*ak2(:)+B43*ak3(:)) - CALL derivs(ytemp,ak4) - ytemp(:)=y(:)+h*(B51*dydt(:)+B52*ak2(:)+B53*ak3(:)+B54*ak4(:)) - CALL derivs(ytemp,ak5) - ytemp(:)=y(:)+h*(B61*dydt(:)+B62*ak2(:)+B63*ak3(:)+B64*ak4(:)+B65*ak5(:)) - CALL derivs(ytemp,ak6) - yout(:)=y(:)+h*(C1*dydt(:)+C3*ak3(:)+C4*ak4(:)+C6*ak6(:)) - yerr(:)=h*(DC1*dydt(:)+DC3*ak3(:)+DC4*ak4(:)+DC6*ak6(:)) - RETURN -END - -!********************************************************************** -SUBROUTINE speed(xg,yg,dir,cg,depth,dcdx,dcdy,Umean,Vmean, gUx, gUy, gVx, gVy) -!********************************************************************** -! Wave speed gradients, from Dobson (1967), for not-too-shallow water -! Code by William C. O'Reilly (1990-1998) -! Modified by Fabrice Ardhuin (1999) to accomodate any depth. -! Modified .................. 11/8/2000 with a Newton-Rapson method for -! the inversion of the dispersion relation -!********************************************************************** -! uses biquadric interpolation (bilinear would not be smooth) -!... calculates the depth, wave phase speed and gradients -! Positions of the grid points (+) used in the computations -! The current point xg,yg (*) is located in the [1,2,3,4] rectangle -! + 8 + 7 -! -! + 9 + 4 + 3 + 6 -! * -! + 10 + 1 + 2 + 5 -! -! + 11 + 12 -!********************************************************************** - USE BATHYGRID - USE Constants - USE RKparam - IMPLICIT NONE - REAL, INTENT(in) ::xg,yg,dir - REAL, INTENT(out) ::cg,depth,dcdx,dcdy,Umean,Vmean, gUx, gUy, gVx, gVy - REAL(KIND=4), POINTER :: grid0(:,:) - REAL(KIND=4), POINTER,DIMENSION(:,:) :: einter - REAL (KIND=4), POINTER,DIMENSION(:,:) :: dinter - REAL,DIMENSION(12,6),SAVE :: sxy=reshape((/ 0.30861241,0.23684207,0.21770331, & - 0.23684207,-0.08492823,-0.05143541,-0.05143541,-0.08492823,0.00598086, & - 0.13038277,0.13038277,0.00598086, & - 0.05322964,0.19677030,0.14413872,0.10586122,0.09031100,-0.06758374, & - -0.03349283,0.03349282,-0.18241626,-0.34031099,-0.12440190,0.12440190, & - 0.05322964,0.10586122,0.14413872,0.19677030,0.03349282,-0.03349283, & - -0.06758374,0.09031099,0.12440190,-0.12440191,-0.34031099,-0.18241625, & - -0.125,-0.125,-0.125,-0.125,0.125,0.125, & - 0.,0.,0.125,0.125,-0.,-0., & - 0.05263157,-0.05263157,0.05263158,-0.05263157,-0.15789473,0.15789474, & - 0.15789474,-0.15789473,-0.15789473,0.15789473,0.15789473,-0.15789473, & - -0.125,-0.125,-0.125,-0.125,0.,0., & - 0.125,0.125,-0.,-0.,0.125,0.125 /),(/12,6/)) - - - INTEGER i,j,ifield - REAL X,Y,sigma,dy,k,c,mean,gx, gy, sigma2, Up - REAL xm,ym,xp,yp,sig,aka,yhat,t,a,dddx,dddy,dcdd - - xm=MAX(2.,MIN(xg,FLOAT(nx)-2.)) - ym=MAX(2.,MIN(yg,FLOAT(ny)-2.)) - i=INT(xm) - j=INT(ym) - xp=mod(xm,1.0) - yp=mod(ym,1.0) - - IF (ip.ne.i.OR.jp.NE.j) THEN - ip=i - jp=j - DO ifield=1,3 - IF (ifield.EQ.1) THEN - GRID0=> GRID - einter=> gride - dinter=> gridd - ENDIF - IF (ifield.EQ.2) THEN - GRID0=> U - einter=> Ue - dinter=> Ud - ENDIF - IF (ifield.EQ.3) THEN - GRID0=> V - einter=> Ve - dinter=> Vd - ENDIF - dinter(1,11)=grid0(i,j-1) - dinter(1,12)=grid0(i+1,j-1) - dinter(1,10)=grid0(i-1,j) - dinter(1,1 )=grid0(i,j) - dinter(1,2)=grid0(i+1,j) - dinter(1,5)=grid0(i+2,j) - dinter(1,9)=grid0(i-1,j+1) - dinter(1,4)=grid0(i,j+1) - dinter(1,3)=grid0(i+1,j+1) - dinter(1,6)=grid0(i+2,j+1) - dinter(1,8)=grid0(i,j+2) - dinter(1,7)=grid0(i+1,j+2) - einter=MATMUL(dinter,sxy) - ENDDO - ENDIF - DO ifield=1,3 - IF (ifield.EQ.1) THEN - GRID0=> GRID - einter=> gride - dinter=> gridd - ENDIF - IF (ifield.EQ.2) THEN - GRID0=> U - einter=> Ue - dinter=> Ud - ENDIF - IF (ifield.EQ.3) THEN - GRID0=> V - einter=> Ve - dinter=> Vd - ENDIF - - mean=einter(1,1)+(einter(1,2)+einter(1,4)*xp+einter(1,5)*yp)*xp & - +(einter(1,3)+einter(1,6)*yp)*yp -!... gradients of bottom depths - gx=einter(1,4)*2.*xp+einter(1,5)*yp+einter(1,2) - gy=einter(1,6)*2.*yp+einter(1,5)*xp+einter(1,3) - - IF (ifield.EQ.1) THEN - depth=mean - dddx=gx - dddy=gy - ENDIF - IF (ifield.EQ.2) THEN - Umean=mean - gUx=gx - gUy=gy -!IF (abs(U(i,j)) > 0.1) WRITE(6,*) 'TEST 2:',ifield,Umean,gx,gy,'#',U(i,j),grid0(i,j),Ud - ENDIF - IF (ifield.EQ.3) THEN - Vmean=mean - gVx=gx - gVy=gy -!WRITE(6,*) 'TEST 3:',ifield,Vmean,U(i,j),grid0(i,j) - ENDIF - END DO - -!... adjust water level here - depth=depth+deltaz - - IF(depth.lt.0.3) depth=0.3 - dl=depth -!... calculate phase speed gradient with depth -!... (accurate in Shallow Water where Dobson was not) - Up=(cos(dir)*Umean+sin(dir)*Vmean) - CALL DISPcur(depth,freq,Up,k,c,cg) - sigma=c*k - sigma2=freq*tpi - Y=(sigma**2*DEPTH)/G - X=k*DEPTH - ! WRITE(6,*) 'SIGMA:',sigma,Up,Umean,Vmean,sigma2 - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - !dk=aka/depth - !cg=tpi*freq/dk - !rc=c/co - ! old formula: Dobson - ! dcdd=sig*(1.-rc*rc)/(c*rc+sig*depth*(1-rc*rc)) - ! the following formula is exaclty equivalent to Dobson in deep water - ! but it is accurate in shallow water - dcdd=(1-y/(y+x**2-y**2))/depth !=(dc/dh)/c - dcdx=dcdd*dddx - dcdy=dcdd*dddy - !WRITE(6,*) 'SPEED',X,Y,I1,xinvxtanh(I1+1),k,c - !WRITE(6,*) 'SPEED',xg,yg,cg,depth,dcdx,dcdy - RETURN - END - -!********************************************************************* - SUBROUTINE DISP(depth,freq,k,c,cg) -!********************************************************************* - USE Constants - IMPLICIT NONE - REAL, INTENT(in) ::depth,freq !depth (m) and frequency (Hz) - REAL, INTENT(out) ::k,c,cg !wave number (m-1),phase speed (m/s) - REAL dep,sigma,X,Y,dy - INTEGER I - - dep=depth - IF (depth.LT.1) dep=1. - sigma=freq*tpi - Y=(sigma**2*DEP)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy - ENDIF - k=X/DEP - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - - RETURN - END - -!********************************************************************* - SUBROUTINE DISPcur(depth,freq,Up,k,c,cg) -!********************************************************************* - USE Constants - IMPLICIT NONE - REAL, INTENT(in) ::depth,freq, Up !depth (m) and frequency (Hz), and current in wave direction - REAL, INTENT(out) ::k,c,cg !wave number (m-1),phase speed (m/s) - REAL dep,omega,sigma,X,Y,dy,DC,Ur - INTEGER I,I2 - - dep=depth - IF (depth.LT.1) dep=1. - omega=freq*tpi - Y=(omega**2*DEP)/G - Ur=Up/sqrt(g*dep) - IF (Y.GE.14.5) THEN - IF (Up.GT.0.1) THEN - k=((2*omega*Up+g)-sqrt(g**2+4*omega*Up*g))/(2*Up**2) - ELSE - k=omega**2/g - ENDIF - ELSE - I=INT(Y*REAL(ntanh)/15.) -! Y=15.*REAL(J)/ntanh -! Up=20.*(-100+REAL(J2))/ncur - I2=INT(Ur*REAL(ncur)/2.+100) - dy=mod(Y*REAL(ntanh)/15.,1.0) - dC=mod(Ur*REAL(ncur)/2.+100,1.0) - X=(invxtanhxc(I,I2)*(1-dy)+invxtanhxc(I+1,I2)*dy)*(1-dC) & - +(invxtanhxc(I,I2+1)*(1-dy)+invxtanhxc(I+1,I2+1)*dy)*(dC) - k=X/DEP - ENDIF - sigma=sqrt(g*k*tanh(k*dep)) - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - !WRITE(6,*) 'TEST1:',I,I2,Y,Up,(omega-k*Up)**2*DEP/g,(sigma)**2*DEP/g,k*dep*tanh(k*dep) - - RETURN - END - - -!********************************************************************* - SUBROUTINE TABULATE -!********************************************************************* - USE Constants - USE RKPARAM - IMPLICIT NONE - - REAL X,Y,H,F,FD - INTEGER I,J - ntanh=2000 - ALLOCATE(invxtanhx(0:ntanh)) - DO J=0,ntanh - Y=15.*REAL(J)/ntanh - X=Y - F=1. - DO 10 I=1,100 - H=TANH(X) - F=Y-X*H - IF (ABS(F) .LT. 1.E-6) GO TO 20 - FD=-H-X/COSH(X)**2 - X=X-F/FD -10 CONTINUE - PRINT *,' SUBROUTINE DISP DOES NOT CONVERGE !!! ' -20 invxtanhx(J)=X - ENDDO - RETURN - END - -!********************************************************************* - SUBROUTINE TABULATECUR -!********************************************************************* - USE Constants - USE RKPARAM - IMPLICIT NONE - - REAL X,Y,H,F,FD, Up - INTEGER I,J,J2 - ntanh=2000 - ncur=200 - ALLOCATE(invxtanhxc(0:ntanh,0:ncur)) - DO J=0,ntanh - DO J2=0,ncur - Y=15.*REAL(J)/ntanh - Up=2.*(-100+REAL(J2))/ncur - X=Y - F=1. - DO 10 I=1,100 - H=TANH(X) - F=Y-X*H+X**2*Up**2-2*X*sqrt(Y)*Up - IF (ABS(F) .LT. 1.E-6) GO TO 20 - FD=-H-X/COSH(X)**2+2*X*Up**2-2*sqrt(Y)*Up - X=X-F/FD -10 CONTINUE -! PRINT *,' SUBROUTINE DISP DOES NOT CONVERGE !!! ',Y,Up -20 invxtanhxc(J,J2)=X - !IF (J.EQ.214.AND.J2.EQ.120) WRITE(6,*) 'TEST:',Y,invxtanhxc(J,J2),Up,F,(Y-X*Up/g),X*H - !IF (J.EQ.215.AND.J2.EQ.120) WRITE(6,*) 'TEST:',Y,invxtanhxc(J,J2),Up,F,(Y-X*Up/g),X*H - ENDDO - ENDDO - RETURN - END - -!********************************************************************** -!********************************************************************** -!********************************************************************** -!********************************************************************** -PROGRAM rayplot ! Forward ray-tracing version - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL distance,theta0,xs,ys,sig,dw,dk,c,cg,dto,h_len2,delx,dely - REAL h_len,dxy,dcdx,dcdy,a_step,ang,angs, depth, Up,wn - INTEGER I,J,nrays,Iray,k,ircode,Iray1 - CHARACTER(len=160):: fblog,fbathy - - CALL Tabulate -depth=10. -freq=0.1 -Up=2 - - CALL DISP(depth,freq,wn,c,cg) -!WRITE(6,*) 'disp test:',wn,C,g*wn*tanh(wn*depth),(tpi*freq)**2 - CALL TABULATECUR - CALL DISPcur(depth,freq,Up,wn,c,cg) -!WRITE(6,*) 'UPP:',wn,C,g*wn*tanh(wn*depth),(tpi*freq-wn*Up)**2 -! STOP - - OPEN(3,file='Ray3a.inpray',status='old') - READ(3,'(a)') fblog - READ(3,'(a)') fbathy - READ(3,*) nrays - READ(3,*) freq,distance,theta0,timestep,depthmax,depthmin - READ(3,*) deltaz - !READ(3,*) xs,ys - - h_len=100 - - eps=0.0001 ! error tolerance in ray integration - -!------------------------------------------------------------------- -! Get bathymetry grid data -!------------------------------------------------------------------- - open(2,file=fblog) - read(2,*) rlonmax,rlonmin,rlatmin,rlatmax - read(2,*) rot - read(2,*) sx,sy - read(2,*) nx,ny - close(2) - yscal(1)=REAL(nx) - yscal(2)=REAL(ny) - yscal(3)=1. - -! Get the grid itself - ALLOCATE(grid(nx,ny),U(nx,ny),V(nx,ny)) - open(2,file=fbathy,form='unformatted',access='direct',recl=4*ny) - DO i=1,nx !beware 1 should be replaced by 4 on HP terminals - read(2,rec=i) (grid(i,j),j=1,ny) - ENDDO - CLOSE(2) - DO j=1,ny !beware 1 should be replaced by 4 on HP terminals - !DO i=1,nx - read(3,*) U(1:NX,j) - IF (J.EQ.133) WRITE(6,*) 'J:',j,U(1:20,j) - !ENDDO - ENDDO - DO j=1,ny !beware 1 should be replaced by 4 on HP terminals - read(3,*) (V(i,j),i=1,nx) - ENDDO - CLOSE(3) - - WRITE(6,*) 'CURRENT:',MAXVAL(U),MINVAL(U),MAXVAL(V),MINVAL(V) - - sig=2.*pi*freq - - dw=800. - call disp(dw,freq,dk,c,cg) !calculate deep water phase speed - dto=timestep*60. - h_len2=cg*dto*0.1 !lengthen the steps for long output timestep - IF (h_len2 > h_len) h_len=h_len2 - - co=c - hmin=0. - !IF (h_len.GT.(sx+sy)*0.25) h_len=(sx+sy)*0.25 - h1=h_len/co !calculate initial ray time steps, h1 - ! (major factor in computation time) - - OPEN(995,file='rays.asc',status='unknown') - WRITE(6,*) 'Ray direction:',theta0 - ang=MOD(theta0,180.) !+180 - if (ang.GT.90) ang=ang-180. - if (ang.LT.-90) ang=ang+180. - WRITE(6,*) 'changed to:',ang,MOD(theta0,180.) - xs=21 - ys=21 - Iray1=0 - angs=ang*d2r !transforms to radians - delx=distance*1000./sx/sin(angs) - dely=distance*1000./sy/cos(angs) - WRITE(6,*) 'DELX,DELY:',distance,delx,dely,xs,ys,ang - IF ((delx.GT.0).AND.(dely.GT.0)) THEN - xs=21 - ys=ny-20 - ENDIF - DO IRAY=1,nrays - !WRITE(6,*) 'ray before:',IRAY,Iray1,xs,ys,ang - CALL ref(xs,ys,angs,ircode) - !WRITE(6,*) 'ray after :',IRAY,Iray1,xs,ys,ang,ircode - write(995,*) nchunk,ircode - write(995,*) (xch(k),k=1,nchunk), & - (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - - IF (delx.LT.0) THEN - IF (ABS(cos(angs)).GT.1E-5.AND.ys.LT.(ny-20)) THEN - ys=ys+dely - ELSE - ys=ny-20 - ENDIF - IF (ys.GT.(ny-20)) THEN - xs=xs+ABS((ys-ny+20)*sy/sx/tan(angs)) - ys=ny-20 - Iray1=Iray - ENDIF - IF (ys.EQ.ny-20.AND.(Iray.NE.Iray1)) THEN - xs=xs-delx - ENDIF - ELSE - IF (dely.GT.0) THEN - IF (ABS(cos(angs)).GT.1E-5.AND.ys.GT.21) THEN - ys=ys-dely - ELSE - ys=21 - ENDIF - IF (ys.LT.(21)) THEN - xs=xs+ABS((21-ys)*tan(angs)*sy/sx) - ys=21 - Iray1=Iray - ENDIF - ELSE - IF (ABS(cos(angs)).GT.1E-5.AND.ys.LT.(ny-20)) THEN - ys=ys-dely - ELSE - ys=ny-20 - ENDIF - - IF (ys.LT.(21)) THEN - xs=xs+ABS((ys-(ny-20))*tan(angs)*sy/sx) - ys=ny-20 - Iray1=Iray - ENDIF - ENDIF - - IF (ys.EQ.21.AND.(Iray.NE.Iray1)) THEN - xs=xs+delx - ENDIF - ENDIF - ENDDO - CLOSE(995) - END diff --git a/model/aux/idl_twist/raypg.f90 b/model/aux/idl_twist/raypg.f90 deleted file mode 100755 index 9570e1dba..000000000 --- a/model/aux/idl_twist/raypg.f90 +++ /dev/null @@ -1,574 +0,0 @@ -!********************************************************************* -MODULE RKPARAM !parameters for Runge Kutta solver - REAL,DIMENSION(3) :: yscal - REAL h1,hmin,eps - REAL co,freq,dl - INTEGER,PARAMETER :: ndim=3 -END MODULE RKPARAM -!********************************************************************* -MODULE BATHYGRID !bottom topography grid - REAL rlonmax,rlonmin,rlatmin,rlatmax,rot - INTEGER nx,ny,ip,jp - REAL sx,sy,deltaz - REAL(kind=4) ,DIMENSION(:,:),ALLOCATABLE :: grid - REAL ,DIMENSION(1,6) :: einter - REAL ,DIMENSION(1,12) :: dinter -END MODULE BATHYGRID -!********************************************************************* -MODULE Raytraj !bottom topography grid - real xch(500),ych(500),ach(500) - INTEGER nchunk - REAL timestep,depthmin,depthmax -END MODULE Raytraj -!********************************************************************* -MODULE Constants - REAL, PARAMETER :: pi = 3.14159265,tpi=6.2831853,d2r=.01745329 - REAL, PARAMETER :: max15bit=32768.,max8bit=256.,max7bit=128. - REAL, PARAMETER :: max14bit=16384. - INTEGER, PARAMETER :: i15bit=32768,i8bit=256,i7bit=128,i14bit=16384 - REAL, PARAMETER :: g = 9.81 !gravity : SI (m/s^2) - REAL, PARAMETER :: rhow = 1026. !water density : SI (kg/m^3) - REAL, PARAMETER :: kappa = 0.4 !Von Karman's constant - REAL, PARAMETER :: nu = 3.E-6 !Salt water kinematic viscosity - REAL, DIMENSION(:),ALLOCATABLE ::invxtanhx - INTEGER ntanh -END MODULE Constants - -!********************************************************************** -SUBROUTINE tfact(depth,f,fact,fact2) -!... calculates the transformation factor (dk/dko)*(cgo/cg) -!... to avoid floating point exception in sinh, max value of sig=75 -!... first get wave no. and group velocity at transformation site - IMPLICIT NONE - REAL, INTENT(in) ::depth,f - REAL, INTENT(out) ::fact,fact2 - REAL d,dk,c,cg,dk0,c0,cg0 - - CALL disp(depth,f,dk,c,cg) - d=800. - CALL disp(d,f,dk0,c0,cg0) - fact=(dk/dk0)*(cg0/cg) - fact2=(dk/cg) - RETURN -END - - -!********************************************************************* -SUBROUTINE ref(xs,ys,as,iflag) -!********************************************************************* -! This routine integrates the ray equations (using the Cash-Karp Runge-Kutta -! driver RKdriver, from the initial position (xs,ys) until it crosses into a -! different zone. The subroutine returns the position and direction of the -! ray at the zone boundary. -! -! If the Fsource flag is equal to 1 then the routine also computes linear interpolation -! coefficents from the grid points. These coefficients are weighted by the propagation time. -! In order to do that the routine keeps track of the current timestep, -! direction bin and triangle. If any of these change then a new set of -! interpolation coefficients is generated. If not, the coefficients are updated -! and are given more weight. This is checked at every mini-timestep (h1) of the -! RKdriver. -! -! When the zone boundary is reached, coefficents are genrated in order -! to be able to interpolate energy density from the neighboring grid -! points at the end of the ray. -!********************************************************************* - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL,INTENT(inout) :: xs,ys,as !start position (grid units) and angle (rad) - INTEGER,INTENT(out) :: iflag !IFlag=0 hit land or cross-shelf boundary, - - REAL x1,x2,tchunk,dt1 - REAL yrad(3) ! current x,y, and angle - INTEGER kchunk,nstep - - !WRITE(6,*) 'xs ....',xs,ys,as,iflag - yrad(1)=xs - yrad(2)=ys - yrad(3)=as - - tchunk=0. - IFlag=2 - nchunk=0 - -! Starts first chunk - CALL RKdriver(yrad) !take a step - dt1=h1/(60.) !time = time step * (C / Cg) - tchunk=dt1 - kchunk=1 - - DO nstep=1,100000 - CALL RKdriver(yrad) !take a step - tchunk=tchunk+dt1 - - - IF (tchunk.GT.timestep) THEN !timestep change - nchunk=nchunk+1 - xch(nchunk)=yrad(1)/d2r - ych(nchunk)=yrad(2)/d2r - ach(nchunk)=yrad(3)/d2r - tchunk=tchunk-timestep - ENDIF - - IF (ip.lt.20.or.ip.gt.nx-20) IFlag=0 - IF (jp.lt.20.or.jp.gt.ny-20) IFlag=0 - !WRITE(6,*) 'Iflag 1:',Iflag,ip,jp,nx,ny - IF (dl.gt.depthmax) IFlag=1 - IF (dl.lt.depthmin) IFlag=0 - IF (iflag.eq.0.or.iflag.eq.1) THEN - !WRITE(6,*) 'Iflag:',iflag,dl,depthmin,nchunk*timestep+tchunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)/d2r - ych(nchunk)=yrad(2)/d2r - ach(nchunk)=yrad(3)/d2r - RETURN - ENDIF - ENDDO !end of do loop on nstep - print *,' error - too many steps ' - !stop - RETURN - end - - -!********************************************************************** -SUBROUTINE RKdriver(ystart) -! Integrates the 3 starting variables from 0 to h1 -! with accuracy eps. h1 is a guess of the step size, hmin is the -! min step size (0 is ok) ystart is overwritten with the desired -! answer -! yscal is a vector containing the typical scales of each variable -! these scales define the admissible errors: eps*yscal(i) -!********************************************************************** -! The Cash-Karp Runge Kutta solver is adapted to this specific problem -! by Fabrice Ardhuin, june 1999, from Numerical Recipes, 2nd ed. -!********************************************************************** - USE RKPARAM - USE Raytraj - USE Constants - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::ystart - INTEGER,PARAMETER ::maxstp=1000 - REAL,DIMENSION(ndim) :: y,dydt - REAL x,h,hdid,hnext - INTEGER nstp - - x=0. - h=h1 - y(:)=ystart(:) - DO nstp=1,maxstp - !WRITE(6,*) 'RK driver',nstp,y(1),y(2),y(3),h - CALL derivs(y,dydt) - IF(x+h.gt.h1) h=h1-x !limits step if it goes over the remaining - !time h1-x - CALL rkqs(y,dydt,h,hdid,hnext) - x=x+hdid - IF(x.ge.h1) THEN - ystart(:)=y(:) - !WRITE(6,*) 'RKdriver',x,hdid,h1,nstp,dl - !WRITE(6,*) 'ycurr',ystart - RETURN - ENDIF - h=hnext - ENDDO - IF (dl.lt.depthmin) THEN - ELSE - WRITE(6,*) 'Step size too smal in RK driver',nstp,x,h1,hdid - STOP - ENDIF - RETURN -END - -!********************************************************************** -SUBROUTINE rkqs(y,dydt,htry,hdid,hnext) -! Fifth order R-K step with monitoring of local error. Input -! is the n-vector of the input variable y and its derivatives -! dydt at the starting value of x. htry is the stepsize to be -! attempted, eps is the required accuracy and yscal is a -! vector against which error is scaled. On output, y and x -! are replaced by their new values,hid is the accomplished -! stepsize and hnext is the estimate of the next stepsize. -!********************************************************************** - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::y,dydt - REAL, INTENT(in) ::htry - REAL, INTENT(out) ::hdid,hnext - - REAL,PARAMETER :: pgrow=-.2 - REAL,PARAMETER :: pshrink=-.25 - REAL,PARAMETER :: safety=.9 - REAL,PARAMETER :: errcon=1.89e-4 !errcon=(5/safety)**(1/pgrow) - REAL,DIMENSION(3):: yerr,ytemp - REAL h,htemp,errmax - INTEGER i,kount - kount=0 - - h=htry - DO - kount=kount+1 - CALL rkck(y,dydt,h,ytemp,yerr) - errmax=0. - DO i=1,ndim - errmax=MAX(errmax,abs(yerr(i)/yscal(i))) - ENDDO - errmax=errmax/eps - !WRITE(6,*) 'RKQS',errmax,kount,h - IF(errmax.GT.1) THEN - htemp=safety*h*(errmax**pshrink) - h=MAX(htemp,0.1*h) !h should always be positive !! - !I got rid of the test on xnew=x - ELSE - IF(errmax.gt.errcon) THEN - hnext=safety*h*(errmax**pgrow) - ELSE - hnext=5.0*h - ENDIF - hdid=h - y(:)=ytemp(:) - RETURN - ENDIF - ENDDO - !WRITE(6,*) 'Step size too smal in rkqs' - RETURN -END - -!********************************************************************** -SUBROUTINE rkck(y,dydt,h,yout,yerr) -! For ndim variables y and their derivs dydt known at y, use -! to advance solution over an interval h and return the -! incremented variables as yout ( which may be the same as y) -! the SUBROUTINE derivs(y,dydt) returns dydt at y - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y,dydt - REAL, INTENT(in) ::h - REAL,DIMENSION(ndim),INTENT(out) ::yout,yerr - - REAL,DIMENSION(ndim) :: ak2,ak3,ak4,ak5,ak6,ytemp - REAL,PARAMETER :: A2=.2,A3=.3,A4=.6,A5=1.,A6=.875 - REAL,PARAMETER :: B21=.2,B31=.075,B32=9./40. - REAL,PARAMETER :: B41=.3,B42=-.9,B43=1.2 - REAL,PARAMETER :: B51=-11./54.,B52=2.5,B53=-70/27.,B54=35./27. - REAL,PARAMETER :: B61=1631./55296.,B62=175./512.,B63=575./13824. - REAL,PARAMETER :: B64=44275./110592.,B65=253./4096. - REAL,PARAMETER :: C1=37./378.,C3=250./621.,C4=125./594.,C6=512./1771. - REAL,PARAMETER :: DC1=C1-2825./27648.,DC3=C3-18575./48384. - REAL,PARAMETER :: DC4=C4-13525/55296.,DC5=-277/14336,DC6=C6-.25 - - ytemp(:)=y(:)+B21*h*dydt(:) - CALL derivs(ytemp,ak2) - ytemp(:)=y(:)+h*(B31*dydt(:)+B32*ak2(:)) - CALL derivs(ytemp,ak3) - ytemp(:)=y(:)+h*(B41*dydt(:)+B42*ak2(:)+B43*ak3(:)) - CALL derivs(ytemp,ak4) - ytemp(:)=y(:)+h*(B51*dydt(:)+B52*ak2(:)+B53*ak3(:)+B54*ak4(:)) - CALL derivs(ytemp,ak5) - ytemp(:)=y(:)+h*(B61*dydt(:)+B62*ak2(:)+B63*ak3(:)+B64*ak4(:)+B65*ak5(:)) - CALL derivs(ytemp,ak6) - yout(:)=y(:)+h*(C1*dydt(:)+C3*ak3(:)+C4*ak4(:)+C6*ak6(:)) - yerr(:)=h*(DC1*dydt(:)+DC3*ak3(:)+DC4*ak4(:)+DC6*ak6(:)) - RETURN -END - -!********************************************************************** -SUBROUTINE derivs(y,dydt) -! c=phase speed and dydt are the derivatives of the n vectors -! with respect to time. -!********************************************************************** - USE RKPARAM - USE BATHYGRID - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y - REAL,DIMENSION(ndim),INTENT(out)::dydt - REAL mu,nu,sp - REAL xg,yg,cg,depth,dcdx,dcdy,ca,sa,sa2 - - xg=y(1) - yg=y(2) - CALL speed(xg,yg,cg,depth,dcdx,dcdy) - ca=cos(y(3)) - sa=sin(y(3)) - !dydt(3)=cg*(sa*dcdx/sx-ca*dcdy/sy) - - !spherical earth - mu=6378100. !earth radius in meters - nu=6378100. - - !cos(90-y)=-sin(y) - !sin(90-y)=cos(y) - sp=cos(y(2)) - dydt(1)=cg*ca/(nu*sp) ! x and y are the lon,lat in radians - dydt(2)=cg*sa/mu - sa2=ca - dydt(3)=cg*(sa*dcdx/(sx*nu*sp)-ca*dcdy/(sy*mu)-sa2*sin(y(2))/(nu*sp)) - - RETURN -END - - -!********************************************************************** -SUBROUTINE speed(lon,lat,cg,depth,dcdx,dcdy) -!********************************************************************** -! Wave speed gradients, from Dobson (1967), for not-too-shallow water -! Code by William C. O'Reilly (1990-1998) -! Modified by Fabrice Ardhuin (1999) to accomodate any depth. -! Modified .................. 11/8/2000 with a Newton-Rapson method for -! the inversion of the dispersion relation -!********************************************************************** -! uses biquadric interpolation (bilinear would not be smooth) -!... calculates the depth, wave phase speed and gradients -! Positions of the grid points (+) used in the computations -! The current point xg,yg (*) is located in the [1,2,3,4] rectangle -! + 8 + 7 -! -! + 9 + 4 + 3 + 6 -! * -! + 10 + 1 + 2 + 5 -! -! + 11 + 12 -!********************************************************************** - USE BATHYGRID - USE Constants - USE RKparam - IMPLICIT NONE - REAL, INTENT(in) ::lon,lat - REAL, INTENT(out) ::cg,depth,dcdx,dcdy - - REAL,DIMENSION(12,6),SAVE :: sxy=reshape((/ 0.30861241,0.23684207,0.21770331, & - 0.23684207,-0.08492823,-0.05143541,-0.05143541,-0.08492823,0.00598086, & - 0.13038277,0.13038277,0.00598086, & - 0.05322964,0.19677030,0.14413872,0.10586122,0.09031100,-0.06758374, & - -0.03349283,0.03349282,-0.18241626,-0.34031099,-0.12440190,0.12440190, & - 0.05322964,0.10586122,0.14413872,0.19677030,0.03349282,-0.03349283, & - -0.06758374,0.09031099,0.12440190,-0.12440191,-0.34031099,-0.18241625, & - -0.125,-0.125,-0.125,-0.125,0.125,0.125, & - 0.,0.,0.125,0.125,-0.,-0., & - 0.05263157,-0.05263157,0.05263158,-0.05263157,-0.15789473,0.15789474, & - 0.15789474,-0.15789473,-0.15789473,0.15789473,0.15789473,-0.15789473, & - -0.125,-0.125,-0.125,-0.125,0.,0., & - 0.125,0.125,-0.,-0.,0.125,0.125 /),(/12,6/)) - - - INTEGER i,j - REAL X,Y,sigma,dy,k,c - REAL xg,yg,xp,yp,sig,aka,yhat,t,a,dddx,dddy,dcdd - - xg=MOD(lon-rlonmin*d2r,tpi)/sx - yg=(lat-rlatmin*d2r)/sy - !WRITE(6,*) 'Xg...:',lon,lon-rlonmin*d2r,lat,xg,yg,sx,sy - i=INT(xg) - j=INT(yg) - xp=mod(xg,1.0) - yp=mod(yg,1.0) - IF(ip.ne.i.OR.jp.NE.j) THEN - ip=i - jp=j - dinter(1,11)=grid(i,j-1) - dinter(1,12)=grid(i+1,j-1) - dinter(1,10)=grid(i-1,j) - dinter(1,1)=grid(i,j) - dinter(1,2)=grid(i+1,j) - dinter(1,5)=grid(i+2,j) - dinter(1,9)=grid(i-1,j+1) - dinter(1,4)=grid(i,j+1) - dinter(1,3)=grid(i+1,j+1) - dinter(1,6)=grid(i+2,j+1) - dinter(1,8)=grid(i,j+2) - dinter(1,7)=grid(i+1,j+2) - einter=MATMUL(dinter,sxy) - ENDIF - depth=einter(1,1)+(einter(1,2)+einter(1,4)*xp+einter(1,5)*yp)*xp & - +(einter(1,3)+einter(1,6)*yp)*yp - -!... adjust water level here - depth=depth+deltaz - - IF(depth.lt.1.) depth=1. - dl=depth -!... gradients of bottom depths - dddx=einter(1,4)*2.*xp+einter(1,5)*yp+einter(1,2) - dddy=einter(1,6)*2.*yp+einter(1,5)*xp+einter(1,3) -!... calculate phase speed gradient with depth -!... (accurate in Shallow Water where Dobson was not) - sigma=freq*tpi - Y=(sigma**2*DEPTH)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=(invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy) - ENDIF - k=X/DEPTH - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - !dk=aka/depth - !cg=tpi*freq/dk - !rc=c/co - ! old formula: Dobson - !dcdd=sig*(1.-rc*rc)/(c*rc+sig*depth*(1-rc*rc)) - ! the following formula is exaclty equivalent to Dobson in deep water - ! but it is accurate in shallow water - dcdd=(1-y/(y+x**2-y**2))/depth !=(dc/dh)/c - dcdx=dcdd*dddx - dcdy=dcdd*dddy - !WRITE(6,*) 'SPEED',X,Y,I1,xinvxtanh(I1+1),k,c - !WRITE(6,*) 'SPEED',xg,yg,cg,depth,dcdx,dcdy - RETURN - END - -!********************************************************************* - SUBROUTINE DISP(depth,freq,k,c,cg) -!********************************************************************* - USE Constants - IMPLICIT NONE - REAL, INTENT(in) ::depth,freq !depth (m) and frequency (Hz) - REAL, INTENT(out) ::k,c,cg !wave number (m-1),phase speed (m/s) - REAL dep,sigma,X,Y,dy - INTEGER I - - dep=depth - IF (depth.LT.1) dep=1. - sigma=freq*tpi - Y=(sigma**2*DEP)/G - IF (Y.GE.14.5) THEN - X=Y - ELSE - I=INT(Y*REAL(ntanh)/15.) - dy=mod(Y*REAL(ntanh)/15.,1.0) - X=invxtanhx(I)*(1-dy)+invxtanhx(I+1)*dy - ENDIF - k=X/DEP - c=sigma/k - cg=g*((y/x)+x*(1-(y/x)**2))/(2.*sigma) - - RETURN - END - - -!********************************************************************* - SUBROUTINE TABULATE -!********************************************************************* - USE Constants - USE RKPARAM - IMPLICIT NONE - - REAL X,Y,H,F,FD - INTEGER I,J - ntanh=10000 - ALLOCATE(invxtanhx(0:ntanh)) - DO J=0,ntanh - Y=15.*REAL(J)/ntanh - X=Y - F=1. - DO 10 I=1,100 - H=TANH(X) - F=Y-X*H - IF (ABS(F) .LT. 1.E-6) GO TO 20 - FD=-H-X/COSH(X)**2 - X=X-F/FD -10 CONTINUE - PRINT *,' SUBROUTINE DISP DOES NOT CONVERGE !!! ' -20 invxtanhx(J)=X - ENDDO - RETURN - END - -!********************************************************************** -!********************************************************************** -!********************************************************************** -!********************************************************************** -PROGRAM rayplot - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL dtheta,theta0,xs,ys,sig,dw,dk,c,cg,dto,h_len2 - REAL h_len,dxy,dcdx,dcdy,a_step,ang,angs - INTEGER I,J,nrays,Iray,k,ircode - CHARACTER(len=50):: fblog,fbathy - - CALL Tabulate - - - OPEN(3,file='Ray3a.inpray',status='old') - READ(3,'(a)') fblog - READ(3,'(a)') fbathy - READ(3,*) nrays - READ(3,*) freq,dtheta,theta0,timestep,depthmax,depthmin - READ(3,*) deltaz - READ(3,*) xs,ys - CLOSE(3) - - h_len=200 - eps=0.0001 ! error tolerance in ray integration - -!------------------------------------------------------------------- -! Get bathymetry grid data -!------------------------------------------------------------------- - open(2,file=fblog) - read(2,*) rlatmin,rlatmax,rlonmin,rlonmax - read(2,*) rot - read(2,*) sx,sy - read(2,*) nx,ny - close(2) - yscal(1)=REAL(nx) - yscal(2)=REAL(ny) - yscal(3)=1. - - sx=(rlonmax-rlonmin)*d2r/(nx-1) - sy=(rlatmax-rlatmin)*d2r/(ny-1) - WRITE(6,*) 'sx:',sx,sy -! Get the grid itself - - xs=MOD(360+xs+rlonmin,360.)-rlonmin - WRITE(6,*) 'lon,lat:',xs,ys - - ALLOCATE(grid(nx,ny)) - open(2,file=fbathy,form='unformatted',access='direct',recl=4*ny) - DO i=1,nx !beware 1 should be replaced by 4 on HP terminals - read(2,rec=i) (grid(i,j),j=1,ny) - ENDDO - CLOSE(2) - - sig=2.*pi*freq - - dw=8000. - call disp(dw,freq,dk,c,cg) !calculate deep water phase speed - - dto=timestep*60. !converts the time step to seconds - h_len2=cg*dto*0.1 !lengthen the steps for long output timestep - IF (h_len2 > h_len) h_len=h_len2 - - co=c - hmin=0. - h1=h_len/co !calculate initial ray time steps, h1 - ! (major factor in computation time) - xs=xs*d2r - ys=ys*d2r - CALL speed(xs,ys,c,dxy,dcdx,dcdy) - WRITE(6,*) 'speed',xs,ys,dxy,c,dcdx,dcdy - a_step=dtheta - !OPEN(995,file='rays.bin',status='unknown',form='unformatted') - OPEN(995,file='rays.asc',status='unknown') - ang=theta0-a_step - DO IRAY=1,nrays - ang=ang+a_step - angs=ang*d2r !transforms to radians - CALL ref(xs,ys,angs,ircode) - WRITE(6,*) 'ray:',IRAY,xs/d2r,ys/d2r,ang,ircode,nchunk,xch(nchunk),ych(nchunk) - ! write(995) nchunk,ircode - ! write(995) (xch(k),k=1,nchunk), & - ! (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - write(995,*) nchunk,ircode - write(995,*) (xch(k),k=1,nchunk), & - (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - ENDDO - CLOSE(995) - END diff --git a/model/aux/idl_twist/raypg_rayleigh.f90 b/model/aux/idl_twist/raypg_rayleigh.f90 deleted file mode 100644 index 27409c83a..000000000 --- a/model/aux/idl_twist/raypg_rayleigh.f90 +++ /dev/null @@ -1,571 +0,0 @@ -!********************************************************************* -MODULE RKPARAM !parameters for Runge Kutta solver - REAL,DIMENSION(3) :: yscal - REAL h1,hmin,eps - REAL co,freq,dl - INTEGER,PARAMETER :: ndim=3 -END MODULE RKPARAM -!********************************************************************* -MODULE BATHYGRID !bottom topography grid - REAL rlonmax,rlonmin,rlatmin,rlatmax,rot - INTEGER nx,ny,ip,jp - REAL sx,sy,deltaz - REAL(kind=4) ,DIMENSION(:,:),ALLOCATABLE :: grid - REAL ,DIMENSION(1,6) :: einter - REAL ,DIMENSION(1,12) :: dinter -END MODULE BATHYGRID -!********************************************************************* -MODULE Raytraj !bottom topography grid - real xch(1000),ych(1000),ach(1000),cch(1000) - INTEGER nchunk - REAL timestep,depthmin,depthmax -END MODULE Raytraj -!********************************************************************* -MODULE Constants - REAL, PARAMETER :: pi = 3.14159265,tpi=6.2831853,d2r=.01745329 - REAL, PARAMETER :: max15bit=32768.,max8bit=256.,max7bit=128. - REAL, PARAMETER :: max14bit=16384. - INTEGER, PARAMETER :: i15bit=32768,i8bit=256,i7bit=128,i14bit=16384 - REAL, PARAMETER :: g = 9.81 !gravity : SI (m/s^2) - REAL, PARAMETER :: rhow = 1026. !water density : SI (kg/m^3) - REAL, PARAMETER :: kappa = 0.4 !Von Karman's constant - REAL, PARAMETER :: nu = 3.E-6 !Salt water kinematic viscosity - REAL, DIMENSION(:,:),ALLOCATABLE :: Rayleigh - INTEGER ntab -END MODULE Constants - -!********************************************************************** -SUBROUTINE tfact(depth,f,fact,fact2) -!... calculates the transformation factor (dk/dko)*(cgo/cg) -!... to avoid floating point exception in sinh, max value of sig=75 -!... first get wave no. and group velocity at transformation site - IMPLICIT NONE - REAL, INTENT(in) ::depth,f - REAL, INTENT(out) ::fact,fact2 - REAL d,dk,c,cg,dk0,c0,cg0,dcdd - - CALL disp(depth,f,dk,c,cg,dcdd) - d=800. - CALL disp(d,f,dk0,c0,cg0,dcdd) - fact=(dk/dk0)*(cg0/cg) - fact2=(dk/cg) - RETURN -END - - -!********************************************************************* -SUBROUTINE ref(xs,ys,as,iflag,distmax) -!********************************************************************* -! This routine integrates the ray equations (using the Cash-Karp Runge-Kutta -! driver RKdriver, from the initial position (xs,ys) until it crosses into a -! different zone. The subroutine returns the position and direction of the -! ray at the zone boundary. -! -! If the Fsource flag is equal to 1 then the routine also computes linear interpolation -! coefficents from the grid points. These coefficients are weighted by the propagation time. -! In order to do that the routine keeps track of the current timestep, -! direction bin and triangle. If any of these change then a new set of -! interpolation coefficients is generated. If not, the coefficients are updated -! and are given more weight. This is checked at every mini-timestep (h1) of the -! RKdriver. -! -! When the zone boundary is reached, coefficents are genrated in order -! to be able to interpolate energy density from the neighboring grid -! points at the end of the ray. -!********************************************************************* - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL,INTENT(in) :: distmax - REAL,INTENT(inout) :: xs,ys,as !start position (grid units) and angle (rad) - INTEGER,INTENT(out) :: iflag !IFlag=0 hit land or cross-shelf boundary, - - REAL x1,x2,tchunk,dt1, timetot - REAL yrad(3) ! current x,y, and angle - INTEGER kchunk,nstep - - !WRITE(6,*) 'xs ....',xs,ys,as,iflag - yrad(1)=xs - yrad(2)=ys - yrad(3)=as - - tchunk=0. - IFlag=2 - nchunk=0 - timetot=0. - -! Starts first chunk - CALL RKdriver(yrad) !take a step - dt1=h1 - tchunk=dt1 - kchunk=1 - - DO nstep=1,100000 - CALL RKdriver(yrad) !take a step - tchunk=tchunk+dt1 - timetot=timetot+h1 - !WRITE(6,*) 'REF :',nstep,timetot,nchunk,distmax,tchunk,iflag,ip,jp,dl - IF (tchunk.GT.timestep) THEN !timestep change - nchunk=nchunk+1 - xch(nchunk)=yrad(1)/d2r - ych(nchunk)=yrad(2)/d2r - ach(nchunk)=yrad(3)/d2r - cch(nchunk)=dl - tchunk=tchunk-timestep - ENDIF - - !IF (ip.lt.20.or.ip.gt.nx-20) IFlag=0 - IF (jp.lt.20.or.jp.gt.ny-20) IFlag=0 - !WRITE(6,*) 'Iflag 1:',Iflag,ip,jp,nx,ny - IF (dl.gt.depthmax) IFlag=1 - IF (dl.lt.depthmin) IFlag=0 - IF (timetot.gt.distmax) IFlag=1 - IF (iflag.eq.0.or.iflag.eq.1) THEN - !WRITE(6,*) 'Iflag:',iflag,dl,depthmin,nchunk*timestep+tchunk - nchunk=nchunk+1 - xch(nchunk)=yrad(1)/d2r - ych(nchunk)=yrad(2)/d2r - ach(nchunk)=yrad(3)/d2r - cch(nchunk)=dl - RETURN - ENDIF - ENDDO !end of do loop on nstep - print *,' error - too many steps ' - !stop - RETURN - end - - -!********************************************************************** -SUBROUTINE RKdriver(ystart) -! Integrates the 3 starting variables from 0 to h1 -! with accuracy eps. h1 is a guess of the step size, hmin is the -! min step size (0 is ok) ystart is overwritten with the desired -! answer -! yscal is a vector containing the typical scales of each variable -! these scales define the admissible errors: eps*yscal(i) -!********************************************************************** -! The Cash-Karp Runge Kutta solver is adapted to this specific problem -! by Fabrice Ardhuin, june 1999, from Numerical Recipes, 2nd ed. -!********************************************************************** - USE RKPARAM - USE Raytraj - USE Constants - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::ystart - INTEGER,PARAMETER ::maxstp=10000 - REAL,DIMENSION(ndim) :: y,dydt - REAL x,h,hdid,hnext - INTEGER nstp - - x=0. - h=h1 - y(:)=ystart(:) - DO nstp=1,maxstp - CALL derivs(y,dydt) - !WRITE(6,*) 'RK driver',freq,nstp,y(1),y(2),y(3),h,'##',dydt - IF(x+h.gt.h1) h=h1-x !limits step if it goes over the remaining - !time h1-x - CALL rkqs(y,dydt,h,hdid,hnext) - x=x+hdid - IF(x.ge.h1) THEN - ystart(:)=y(:) - !WRITE(6,*) 'RKdriver',x,hdid,h1,nstp,dl - !WRITE(6,*) 'ycurr',ystart - RETURN - ENDIF - h=hnext - ENDDO - IF (dl.lt.depthmin) THEN - ELSE - WRITE(6,*) 'Step size too smal in RK driver',nstp,x,h1,hdid - STOP - ENDIF - RETURN -END - -!********************************************************************** -SUBROUTINE rkqs(y,dydt,htry,hdid,hnext) -! Fifth order R-K step with monitoring of local error. Input -! is the n-vector of the input variable y and its derivatives -! dydt at the starting value of x. htry is the stepsize to be -! attempted, eps is the required accuracy and yscal is a -! vector against which error is scaled. On output, y and x -! are replaced by their new values,hid is the accomplished -! stepsize and hnext is the estimate of the next stepsize. -!********************************************************************** - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(inout) ::y,dydt - REAL, INTENT(in) ::htry - REAL, INTENT(out) ::hdid,hnext - - REAL,PARAMETER :: pgrow=-.2 - REAL,PARAMETER :: pshrink=-.25 - REAL,PARAMETER :: safety=.9 - REAL,PARAMETER :: errcon=1.89e-4 !errcon=(5/safety)**(1/pgrow) - REAL,DIMENSION(3):: yerr,ytemp - REAL h,htemp,errmax - INTEGER i,kount - kount=0 - - h=htry - DO - kount=kount+1 - CALL rkck(y,dydt,h,ytemp,yerr) - errmax=0. - DO i=1,ndim - errmax=MAX(errmax,abs(yerr(i)/yscal(i))) - ENDDO - errmax=errmax/eps - !WRITE(6,*) 'RKQS',errmax,kount,h,eps - IF(errmax.GT.1) THEN - htemp=safety*h*(errmax**pshrink) - h=MAX(htemp,0.1*h) !h should always be positive !! - !I got rid of the test on xnew=x - ELSE - IF(errmax.gt.errcon) THEN - hnext=safety*h*(errmax**pgrow) - ELSE - hnext=5.0*h - ENDIF - hdid=h - y(:)=ytemp(:) - RETURN - ENDIF - ENDDO - !WRITE(6,*) 'Step size too smal in rkqs' - RETURN -END - -!********************************************************************** -SUBROUTINE rkck(y,dydt,h,yout,yerr) -! For ndim variables y and their derivs dydt known at y, use -! to advance solution over an interval h and return the -! incremented variables as yout ( which may be the same as y) -! the SUBROUTINE derivs(y,dydt) returns dydt at y - USE RKPARAM - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y,dydt - REAL, INTENT(in) ::h - REAL,DIMENSION(ndim),INTENT(out) ::yout,yerr - - REAL,DIMENSION(ndim) :: ak2,ak3,ak4,ak5,ak6,ytemp - REAL,PARAMETER :: A2=.2,A3=.3,A4=.6,A5=1.,A6=.875 - REAL,PARAMETER :: B21=.2,B31=.075,B32=9./40. - REAL,PARAMETER :: B41=.3,B42=-.9,B43=1.2 - REAL,PARAMETER :: B51=-11./54.,B52=2.5,B53=-70/27.,B54=35./27. - REAL,PARAMETER :: B61=1631./55296.,B62=175./512.,B63=575./13824. - REAL,PARAMETER :: B64=44275./110592.,B65=253./4096. - REAL,PARAMETER :: C1=37./378.,C3=250./621.,C4=125./594.,C6=512./1771. - REAL,PARAMETER :: DC1=C1-2825./27648.,DC3=C3-18575./48384. - REAL,PARAMETER :: DC4=C4-13525/55296.,DC5=-277/14336,DC6=C6-.25 - - ytemp(:)=y(:)+B21*h*dydt(:) - CALL derivs(ytemp,ak2) - ytemp(:)=y(:)+h*(B31*dydt(:)+B32*ak2(:)) - CALL derivs(ytemp,ak3) - ytemp(:)=y(:)+h*(B41*dydt(:)+B42*ak2(:)+B43*ak3(:)) - CALL derivs(ytemp,ak4) - ytemp(:)=y(:)+h*(B51*dydt(:)+B52*ak2(:)+B53*ak3(:)+B54*ak4(:)) - CALL derivs(ytemp,ak5) - ytemp(:)=y(:)+h*(B61*dydt(:)+B62*ak2(:)+B63*ak3(:)+B64*ak4(:)+B65*ak5(:)) - CALL derivs(ytemp,ak6) - yout(:)=y(:)+h*(C1*dydt(:)+C3*ak3(:)+C4*ak4(:)+C6*ak6(:)) - yerr(:)=h*(DC1*dydt(:)+DC3*ak3(:)+DC4*ak4(:)+DC6*ak6(:)) - RETURN -END - -!********************************************************************** -SUBROUTINE derivs(y,dydt) -! c=phase speed and dydt are the derivatives of the n vectors -! with respect to time. -!********************************************************************** - USE RKPARAM - USE BATHYGRID - IMPLICIT NONE - REAL,DIMENSION(ndim),INTENT(in) ::y - REAL,DIMENSION(ndim),INTENT(out)::dydt - REAL mu,nu,sp - REAL xg,yg,cg,depth,dcdx,dcdy,ca,sa,sa2 - - xg=y(1) - yg=y(2) - CALL speed(xg,yg,cg,depth,dcdx,dcdy) - - ca=cos(y(3)) - sa=sin(y(3)) - !dydt(3)=cg*(sa*dcdx/sx-ca*dcdy/sy) - - !spherical earth - mu=6378100. !earth radius in meters - nu=6378100. - - sp=cos(y(2)) - dydt(1)=cg*ca/(nu*sp) ! x and y are the lon,lat in radians - dydt(2)=cg*sa/mu - sa2=ca - dydt(3)=cg*(sa*dcdx/(sx*nu*sp)-ca*dcdy/(sy*mu)-sa2*sin(y(2))/(nu*sp)) - - RETURN -END - - -!********************************************************************** -SUBROUTINE speed(lon,lat,cg,depth,dcdx,dcdy) -!********************************************************************** -! Wave speed gradients, from Dobson (1967), for not-too-shallow water -! Code by William C. O'Reilly (1990-1998) -! Modified by Fabrice Ardhuin (1999) to accomodate any depth. -! Modified .................. 11/8/2000 with a Newton-Rapson method for -! the inversion of the dispersion relation -!********************************************************************** -! uses biquadric interpolation (bilinear would not be smooth) -!... calculates the depth, wave phase speed and gradients -! Positions of the grid points (+) used in the computations -! The current point xg,yg (*) is located in the [1,2,3,4] rectangle -! + 8 + 7 -! -! + 9 + 4 + 3 + 6 -! * -! + 10 + 1 + 2 + 5 -! -! + 11 + 12 -!********************************************************************** - USE BATHYGRID - USE Constants - USE RKparam - IMPLICIT NONE - REAL, INTENT(in) ::lon,lat - REAL, INTENT(out) ::cg,depth,dcdx,dcdy - - REAL,DIMENSION(12,6),SAVE :: sxy=reshape((/ 0.30861241,0.23684207,0.21770331, & - 0.23684207,-0.08492823,-0.05143541,-0.05143541,-0.08492823,0.00598086, & - 0.13038277,0.13038277,0.00598086, & - 0.05322964,0.19677030,0.14413872,0.10586122,0.09031100,-0.06758374, & - -0.03349283,0.03349282,-0.18241626,-0.34031099,-0.12440190,0.12440190, & - 0.05322964,0.10586122,0.14413872,0.19677030,0.03349282,-0.03349283, & - -0.06758374,0.09031099,0.12440190,-0.12440191,-0.34031099,-0.18241625, & - -0.125,-0.125,-0.125,-0.125,0.125,0.125, & - 0.,0.,0.125,0.125,-0.,-0., & - 0.05263157,-0.05263157,0.05263158,-0.05263157,-0.15789473,0.15789474, & - 0.15789474,-0.15789473,-0.15789473,0.15789473,0.15789473,-0.15789473, & - -0.125,-0.125,-0.125,-0.125,0.,0., & - 0.125,0.125,-0.,-0.,0.125,0.125 /),(/12,6/)) - - - INTEGER i,j - - INTEGER jp1,jp2,jm1,jm2 - REAL X,Y,sigma,dy,k,c, dcdd - REAL xg,yg,xp,yp,sig,aka,yhat,t,a,dddx,dddy - - xg=1.+MOD(lon-rlonmin*d2r,tpi)/sx - yg=1.+(lat-rlatmin*d2r)/sy - i=INT(xg) - j=INT(yg) - xp=mod(xg,1.0) - yp=mod(yg,1.0) - IF(ip.ne.i.OR.jp.NE.j) THEN - ip=i - jp=j -! for a full global grid - jp1=mod(j+1,nx) - jp2=mod(j+2,nx) - jm1=mod(j-1,nx) - jm2=mod(j-2,nx) - dinter(1,11)=grid(i,jm1) - dinter(1,12)=grid(i+1,jm1) - dinter(1,10)=grid(i-1,j) - dinter(1,1)=grid(i,j) - dinter(1,2)=grid(i+1,j) - dinter(1,5)=grid(i+2,j) - dinter(1,9)=grid(i-1,jp1) - dinter(1,4)=grid(i,j+1) - dinter(1,3)=grid(i+1,jp1) - dinter(1,6)=grid(i+2,jp1) - dinter(1,8)=grid(i,j+2) - dinter(1,7)=grid(i+1,jp2) - einter=MATMUL(dinter,sxy) - ENDIF - depth=einter(1,1)+(einter(1,2)+einter(1,4)*xp+einter(1,5)*yp)*xp & - +(einter(1,3)+einter(1,6)*yp)*yp - - dl=depth - - -!... gradients of bottom depths - dddx=einter(1,4)*2.*xp+einter(1,5)*yp+einter(1,2) - dddy=einter(1,6)*2.*yp+einter(1,5)*xp+einter(1,3) -!... calculate phase speed gradient with depth - CALL DISP(depth,freq,k,c,cg,dcdd) - dcdx=dcdd*dddx - dcdy=dcdd*dddy - RETURN - END - -!********************************************************************* - SUBROUTINE DISP(depth,freq,k,c,cg,dcdd) -!********************************************************************* - USE Constants - IMPLICIT NONE - REAL, INTENT(in) ::depth,freq !depth (m) and frequency (Hz) - REAL, INTENT(out) ::k,c,cg,dcdd !wave number (m-1),phase speed (m/s) - REAL dep,sigma,X,Y,dy, LOGFREQ, DLOGFREQ, ffile - INTEGER I, ILOGFREQ - - ffile=2*freq*depth/4720 - IF (ffile.GT.0) THEN - LOGFREQ=1+(LOG(ffile)+7)/0.012638983606093 - ELSE - LOGFREQ=1. - ENDIF - IF (LOGFREQ.GT.1.AND.LOGFREQ.LT.FLOAT(ntab-1)) THEN - ILOGFREQ=FLOOR(LOGFREQ) - DLOGFREQ=LOGFREQ-ILOGFREQ - c=Rayleigh(ILOGFREQ,2)*(1-DLOGFREQ)+Rayleigh(ILOGFREQ+1,2)*DLOGFREQ - k=tpi*freq/c - cg=Rayleigh(ILOGFREQ,3)*(1-DLOGFREQ)+Rayleigh(ILOGFREQ+1,3)*DLOGFREQ - -! computes (dc/dh)/c - dcdd=(2*freq)*(Rayleigh(ILOGFREQ+1,2)-Rayleigh(ILOGFREQ,2)) & - /((Rayleigh(ILOGFREQ+1,1)-Rayleigh(ILOGFREQ,1))*1500)/c - ENDIF - IF (LOGFREQ.LE.1.) THEN - c=Rayleigh(1,2) - k=tpi*freq/c - cg=Rayleigh(1,3) - dcdd=0. - ENDIF - IF (LOGFREQ.GE.FLOAT(ntab-1)) THEN - c=1500. - k=tpi*freq/c - cg=1500. - dcdd=0. - ENDIF - - RETURN - END - - -!********************************************************************* - SUBROUTINE TABULATE_RAYLEIGH -!********************************************************************* - USE Constants - USE RKPARAM - IMPLICIT NONE - - REAL X,Y,H,F,FD - INTEGER I,J - ntab=434 - - ALLOCATE(Rayleigh(1:ntab,3)) - OPEN(3,file='Rayleigh_speed.txt',status='old') - DO J=1,ntab - READ(3,*) Rayleigh(J,:) - ENDDO - CLOSE(3) - RETURN - END - -!********************************************************************** -!********************************************************************** -!********************************************************************** -!********************************************************************** -PROGRAM rayplot - USE BATHYGRID - USE Constants - USE Raytraj - USE RKPARAM - IMPLICIT NONE - - REAL dtheta,theta0,xs,ys,sig,dw,dk,c,cg,dcdd,dto,h_len2 - REAL h_len,dxy,dcdx,dcdy,a_step,ang,angs,distmax - INTEGER I,J,nrays,Iray,k,ircode - CHARACTER(len=120):: fblog,fbathy - - CALL Tabulate_Rayleigh - - - OPEN(3,file='Ray3a.inpray',status='old') - READ(3,'(a)') fblog - READ(3,'(a)') fbathy - READ(3,*) nrays - READ(3,*) freq,dtheta,theta0,timestep,depthmax,depthmin,distmax - freq=0.0373 - READ(3,*) deltaz - READ(3,*) xs,ys - CLOSE(3) - - h_len=200 - eps=0.00001 ! error tolerance in ray integration - -!------------------------------------------------------------------- -! Get bathymetry grid data -!------------------------------------------------------------------- - open(2,file=fblog) - read(2,*) rlatmin,rlatmax,rlonmin,rlonmax - read(2,*) rot - read(2,*) sx,sy - read(2,*) nx,ny - close(2) - yscal(1)=REAL(nx) - yscal(2)=REAL(ny) - yscal(3)=1. - - sx=(rlonmax-rlonmin)*d2r/(nx-1) - sy=(rlatmax-rlatmin)*d2r/(ny-1) - WRITE(6,*) 'sx:',sx,sy -! Get the grid itself - - xs=MOD(360+xs-rlonmin,360.)+rlonmin - WRITE(6,*) 'lon,lat,rlonmin,rlatmin:',xs,ys,rlonmin,rlatmin - - ALLOCATE(grid(nx,ny)) - open(2,file=fbathy,form='unformatted',access='direct',recl=4*ny) - DO i=1,nx !beware 1 should be replaced by 4 on HP terminals - read(2,rec=i) (grid(i,j),j=1,ny) - ENDDO - CLOSE(2) - - sig=2.*pi*freq - - dw=0. - call disp(dw,freq,dk,c,cg,dcdd) !calculate phase speed over land - dto=timestep !converts the time step to seconds - !h_len2=cg*dto*0.2 !lengthen the steps for long output timestep - h_len2=3000. - WRITE(6,*) 'ds2,ds, depth:',h_len2,h_len,dw - - IF (h_len2 > h_len) h_len=h_len2 - - co=c - hmin=0. - h1=h_len/co !calculate initial ray time steps, h1 - ! (major factor in computation time) - - xs=xs*d2r - ys=ys*d2r - CALL speed(xs,ys,c,dxy,dcdx,dcdy) - WRITE(6,*) 'speed',xs,ys,dxy,c,dcdx,dcdy - a_step=dtheta - !OPEN(995,file='rays.bin',status='unknown',form='unformatted') - OPEN(995,file='rays.asc',status='unknown') - ang=theta0-a_step - DO IRAY=1,nrays - ang=ang+a_step - angs=ang*d2r !transforms to radians - CALL ref(xs,ys,angs,ircode,distmax) - WRITE(6,*) 'ray:',IRAY,xs/d2r,ys/d2r,ang,ircode,nchunk,xch(nchunk),ych(nchunk),cch(nchunk) - ! write(995) nchunk,ircode - ! write(995) (xch(k),k=1,nchunk), & - ! (ych(k),k=1,nchunk),(ach(k),k=1,nchunk) - ! write(995,*) nchunk,ircode - write(995,*) (xch(k),k=1,nchunk), & - (ych(k),k=1,nchunk),(ach(k),k=1,nchunk),(cch(k),k=1,nchunk) - ENDDO - CLOSE(995) - END diff --git a/model/aux/idl_twist/raytracer.pro b/model/aux/idl_twist/raytracer.pro deleted file mode 100755 index e09dd1e31..000000000 --- a/model/aux/idl_twist/raytracer.pro +++ /dev/null @@ -1,403 +0,0 @@ -PRO Raytracemenu, anterior_root -COMMON Wray,Wrline1,Wrline2,Wrline3,Wrline4,Wrline5,WRline6 -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath - - - raypath='' - raybase = WIDGET_BASE(TITLE='Ray tracer', /COLUMN) - - WRline1=LONARR(10) - WRline1(0)=WIDGET_BASE(raybase, /FRAME, /ROW) - WRline1(1)=WIDGET_DROPLIST(raybase, $ - VALUE=['ALL RAYS','OFF.RAYS','TRAP.RAYS','NO RAYS']) - - WRline2=LONARR(10) - WRline2(0)= WIDGET_BASE(raybase, /FRAME, /ROW) - WRline2(1)= WIDGET_TEXT(WRline2(0), $ - YSIZE=1,XSIZE=6,VALUE=strcompress('Freq.:')) - WRline2(2)= WIDGET_TEXT(WRline2(0), $ - XSIZE=8,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(rayfreq))) - - WRline3=LONARR(10) - WRline3(0)= WIDGET_BASE(raybase, /FRAME, /ROW) - WRline3(1)= WIDGET_LABEL(WRline3(0),VALUE='dt:') - WRline3(2)= WIDGET_TEXT(WRline3(0), $ - XSIZE=6,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(raytimestep))) - WRline3(3)= WIDGET_LABEL(WRline3(0),VALUE='dth:') - WRline3(4)= WIDGET_TEXT(WRline3(0), $ - XSIZE=6,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(rayres))) - - WRline4=LONARR(10) - WRline4(0)= WIDGET_BASE(raybase, /FRAME, /ROW) - - WRline4(1)= WIDGET_SLIDER(WRline4(0), MAXIMUM=180, MINIMUM=-180, $ - value=rayamin,TITLE='amin') - WRline4(2)= WIDGET_SLIDER(WRline4(0), MAXIMUM=180, MINIMUM=-180, $ - value=180,TITLE='amax') - - WRline5=LONARR(10) - WRline5(0)= WIDGET_BASE(raybase, /FRAME, /ROW) - WRline5(1)= WIDGET_LABEL(WRline5(0),VALUE='Depths, max:') - WRline5(2)= WIDGET_TEXT(WRline5(0), $ - XSIZE=6,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(rayoffdep))) - WRline5(3)= WIDGET_LABEL(WRline5(0),VALUE='Mean:') - WRline5(4)= WIDGET_TEXT(WRline5(0), $ - XSIZE=6,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(raydz))) - WRline5(5)= WIDGET_LABEL(WRline5(0),VALUE='Min:') - WRline5(6)= WIDGET_TEXT(WRline5(0), $ - XSIZE=6,YSIZE=1,/EDITABLE,VALUE=strcompress(STRING(raymindepth))) - - - WRline6=LONARR(10) - WRline6(0)= WIDGET_BASE(raybase, /FRAME, /ROW) - WRline6(2)=WIDGET_BUTTON(WRline6(0),VALUE="Get") - WRline6(3)=WIDGET_BUTTON(WRline6(0),VALUE="Get global") - WRline6(4)=WIDGET_BUTTON(WRline6(0),VALUE="Forward") - WRline6(5)=WIDGET_BUTTON(WRline6(0),VALUE="Forward with current") - Line7 = WIDGET_BUTTON(raybase, VALUE='OK') - - WIDGET_CONTROL, /REALIZE, raybase - XMANAGER, 'Raytracemenu', raybase -RETURN -END - - -;---------------------------------------------------------------------------- -PRO Raytracemenu_event, ev -;** 1 ** Display parameters -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,filltype -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON POSTSCRIPT, filep,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,pssizex,pssizey -COMMON TROISD, Ax3D,Az3D,smoothing -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - -;** 2 ** Display and data variables/parameters -COMMON FREQ, freq,nfband,findex -COMMON DIR, nabin,nabint,aindex,angle -COMMON TIME, tindex,ntime,dtime,time0,day0,dtindex,nstep -COMMON TRANSECT,Ntrans,Xtrans,Ytrans,Ztrans,I1trans,I2trans,alphatrans,betatrans -COMMON SPACE, c_gp,c_cut -COMMON PLOTOP, addir,adgpsym,adbathy,adcoast - -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON ARR8m, nfTom,naTom,TomF,Tomth,OBS8m,MOD8m -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON BUOYPOS, nptrans,KS,depthbuoy,ETF,tabETF -COMMON COAST, coastx,coasty -COMMON DEPTHSTAT,distd,nbinsd -COMMON DIRSPEC, ds,ndir,kdkdth -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON GRIDSPEC,nspecgp,ispecgp,jspecgp,whichgrid,namespecgp,specfontsize -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON SOURCE, S0,snabin,sntstep -COMMON STEADY, ETFM,etfdepth,etffact - -COMMON Wray,Wrline1,Wrline2,Wrline3,Wrline4,Wrline5,WRline6 -COMMON WW3, ww3model,ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path,spec2D,ww3matrix2,ww3dir2,ncid,ncid2 -;*******END OF COMMON BLOCKS******************************* - type = TAG_NAMES(ev, /STRUCTURE) -; IF ev.id EQ WGsl(4) THEN BEGIN -; WIDGET_CONTROL, ev.id, GET_VALUE=value -; gfact=value -; ENDIF ELSE BEGIN - CASE type OF - 'WIDGET_BUTTON': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'Get': BEGIN - raystype=1 - GET_LUN,unit - OPENW,unit,raypath+'Ray3a.inpray' - PRINTF,unit,paths(2)+filenames(2) - PRINTF,unit,paths(3)+filenames(3) - nray=ROUND(ABS(rayamin-rayamax)/rayres+1) - PRINTF,unit,nray - PRINTF,unit,rayfreq,' ',rayres,rayamin,' ',raytimestep,' ',rayoffdep,' ',raymindepth - PRINTF,unit,raydz - PRINTF,unit,gridmat(0,c_gp-1)*1000./sx,gridmat(1,c_gp-1)*1000./sy - print,'Start point:',gridmat(0,c_gp-1)*1000./sx,gridmat(1,c_gp-1)*1000./sy - PRINTF,unit,' ' - CLOSE,unit - free_lun,unit - SPAWN,'rayp' - GET_LUN,unit - ;OPENR,unit,'rays.bin' - OPENR,unit,raypath+'rays.asc' - raynsteps=INTARR(nray) - rayflag=INTARR(nray) - raya=FLTARR(nray,500) - rayx=FLTARR(nray,500) - rayy=FLTARR(nray,500) - l=0 - flagr=0 - dummy=0 - ; dummies fill in the overhead info of the 'unformatted' - ; fortran binary file - FOR I=0,nray-1 DO BEGIN - ;READU,unit,dummy,dummy,dummy,l,dummy,flagr - READF,unit,l,flagr - ;PRINT,I,l,flagr - raynsteps(I)=l - rayflag(I)=flagr - x=FLTARR(l) - y=FLTARR(l) - a=FLTARR(l) - ; READU,unit,dummy,dummy,dummy,dummy,x,y,a - ; READU,unit,dummy,dummy - READF,unit,x,y,a - - ;PRINT,'X',x - ;PRINT,'Y',y - ;PRINT,'a',a - rayx(I,0:(l-1))=x - rayy(I,0:(l-1))=y - raya(I,0:(l-1))=a - ENDFOR - CLOSE,unit - free_lun,unit - RaysOK=1 - doplot - END -'Get global': BEGIN - raystype=1 - print,'LAT,LON:',gridmat(2,c_gp-1),gridmat(4,c_gp-1) - GET_LUN,unit - OPENW,unit,raypath+'Ray3a.inpray' - PRINTF,unit,paths(2)+filenames(2) - PRINTF,unit,paths(3)+filenames(3) - nray=ROUND(ABS(rayamin-rayamax)/rayres+1) - PRINTF,unit,nray - PRINTF,unit,rayfreq,' ',rayres,rayamin,' ',raytimestep,' ',rayoffdep,' ',raymindepth - PRINTF,unit,raydz - lat=gridmat(2,c_gp-1)+gridmat(3,c_gp-1)/60. - lon=gridmat(4,c_gp-1)+gridmat(5,c_gp-1)/60. - IF lon LT rlonmin THEN lon=lon+360. - PRINTF,unit,lon,lat - print,'Start point (lat,lon):',lat,lon - PRINTF,unit,' ' - CLOSE,unit - free_lun,unit - SPAWN,'raypg' - GET_LUN,unit - ;OPENR,unit,'rays.bin' - OPENR,unit,raypath +'rays.asc' - raynsteps=INTARR(nray) - rayflag=INTARR(nray) - raya=FLTARR(nray,500) - rayx=FLTARR(nray,500) - rayy=FLTARR(nray,500) - l=0 - flagr=0 - dummy=0 - ; dummies fill in the overhead info of the 'unformatted' - ; fortran binary file - FOR I=0,nray-1 DO BEGIN - ;READU,unit,dummy,dummy,dummy,l,dummy,flagr - READF,unit,l,flagr - ;PRINT,I,l,flagr - raynsteps(I)=l - rayflag(I)=flagr - lon=FLTARR(l) - lat=FLTARR(l) - a=FLTARR(l) - X=FLTARR(l) - y=FLTARR(l) - - ; READU,unit,dummy,dummy,dummy,dummy,x,y,a - ; READU,unit,dummy,dummy - READF,unit,lon,lat,a - FOR J=0,l-1 DO BEGIN - lonj=lon(J) - latj=lat(J) - LatlontoXY,latJ,0.,lonJ,0.,xl,yl - x(J)=xl - y(J)=yl - ENDFOR - ; PRINT,'X',x,lon - ;PRINT,'Y',y,lat - ;PRINT,'a',a - rayx(I,0:(l-1))=x - rayy(I,0:(l-1))=y - raya(I,0:(l-1))=a - ENDFOR - CLOSE,unit - free_lun,unit - RaysOK=1 - doplot - END - 'Forward': BEGIN - raystype=2 - GET_LUN,unit - OPENW,unit,raypath+'Ray3a.inpray' - PRINTF,unit,paths(2)+filenames(2) - PRINTF,unit,paths(3)+filenames(3) - ; The rays are separated by the same distance rayres - nray=FLOOR(((nx-41)*dx*ABS(sin(rayamin*!dtor)) $ - +(ny-41)*dy*ABS(cos(rayamin*!dtor)))/rayres) - rayamax=(nray-1)*rayres+rayamin - PRINTF,unit,nray - PRINTF,unit,rayfreq,rayres,rayamin,raytimestep,rayoffdep,raymindepth,FORMAT='(6F13.7)' - PRINTF,unit,raydz - - PRINTF,unit,' ' - CLOSE,unit - free_lun,unit - SPAWN,'raypf' - GET_LUN,unit - OPENR,unit,raypath+'rays.asc' - raynsteps=INTARR(nray) - rayflag=INTARR(nray) - raya=FLTARR(nray,3000) - rayx=FLTARR(nray,3000) - rayy=FLTARR(nray,3000) - l=0 - flagr=0 - dummy=0 -; dummies fill in the overhead info of the 'unformatted' -; fortran binary file - FOR I=0,nray-1 DO BEGIN - READF,unit,l,flagr - raynsteps(I)=l - rayflag(I)=flagr - x=FLTARR(l) - y=FLTARR(l) - a=FLTARR(l) - READF,unit,x,y,a - - rayx(I,0:(l-1))=x - rayy(I,0:(l-1))=y - raya(I,0:(l-1))=a - ENDFOR - CLOSE,unit - free_lun,unit - RaysOK=1 - doplot - END - - 'Forward with current': BEGIN - raystype=2 - x=(findgen(nx))*dx - y=(findgen(ny))*dy - XGP=FLTARR(nngp) - YGP=FLTARR(nngp) - XGP(0:nngp-1)=gridmat(0,0:nngp-1) - YGP(0:nngp-1)=gridmat(1,0:nngp-1) - - TRIANGULATE,xgp,ygp,tr,b - dircos=TRIGRID(xgp,ygp,ww3matrix*cos(ww3dir*!dtor),tr, $ - [dx,dy],[MIN(X), MIN(Y), MAX(X), MAX(Y)],XOUT=X,YOUT=Y) - dirsin=TRIGRID(xgp,ygp,ww3matrix*sin(ww3dir*!dtor),tr, $ - [dx,dy],[MIN(X), MIN(Y), MAX(X), MAX(Y)],XOUT=X,YOUT=Y) - Index=WHERE(FINITE(dircos) EQ 0, kount) - IF (kount GT 0) THEN BEGIN - dircos(Index)=0. - dirsin(Index)=0. - ENDIF - GET_LUN,unit - OPENW,unit,raypath+'Ray3a.inpray' - PRINTF,unit,paths(2)+filenames(2) - PRINTF,unit,paths(3)+filenames(3) - ; The rays are separated by the same distance rayres - nray=FLOOR(((nx-41)*dx*ABS(sin(rayamin*!dtor)) $ - +(ny-41)*dy*ABS(cos(rayamin*!dtor)))/rayres) - rayamax=(nray-1)*rayres+rayamin - PRINTF,unit,nray - PRINTF,unit,rayfreq,rayres,rayamin,raytimestep,rayoffdep,raymindepth,FORMAT='(6F13.7)' - PRINTF,unit,raydz - - PRINT,'DIRCOSBB :',size(dircos),nx,ny - PRINTF,unit,' ' - FOR J=0,NY-1 DO BEGIN - PRINTF,unit,-1.*dirsin(*,J),FORMAT='(20F8.3)' - ENDFOR - FOR J=0,NY-1 DO BEGIN - PRINTF,unit,-1.*dircos(*,J),FORMAT='(20F8.3)' - ENDFOR - CLOSE,unit - free_lun,unit - SPAWN,'raypfc' - GET_LUN,unit - OPENR,unit,raypath+'rays.asc' - raynsteps=INTARR(nray) - rayflag=INTARR(nray) - raya=FLTARR(nray,3000) - rayx=FLTARR(nray,3000) - rayy=FLTARR(nray,3000) - l=0 - flagr=0 - dummy=0 -; dummies fill in the overhead info of the 'unformatted' -; fortran binary file - FOR I=0,nray-1 DO BEGIN - READF,unit,l,flagr - raynsteps(I)=l - rayflag(I)=flagr - x=FLTARR(l) - y=FLTARR(l) - a=FLTARR(l) - READF,unit,x,y,a - - rayx(I,0:(l-1))=x - rayy(I,0:(l-1))=y - raya(I,0:(l-1))=a - ENDFOR - CLOSE,unit - free_lun,unit - RaysOK=1 - doplot - END - - - 'OK': BEGIN - WIDGET_CONTROL, /DESTROY, ev.top - RETURN - END - ENDCASE - END - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE ev.id OF - WRline2(2):rayfreq=FLOAT(value(0)) - WRline3(2):raytimestep=FLOAT(value(0)) - WRline3(4):rayres=FLOAT(value(0)) - WRline5(2):rayoffdep=FLOAT(value(0)) - WRline5(4):raydz=FLOAT(value(0)) - WRline5(6):raymindepth=FLOAT(value(0)) - ENDCASE - END - 'WIDGET_DROPLIST':BEGIN - CASE ev.id of - WRline1(1): BEGIN - raysOK=ev.index - doplot - END - ENDCASE - END - 'WIDGET_SLIDER': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - WRline4(1):BEGIN - rayamin=FLOAT(value) - END - WRline4(2):BEGIN - rayamax=FLOAT(value) - END - ENDCASE - END - ENDCASE -; ENDELSE -RETURN -END - diff --git a/model/aux/idl_twist/read_timeseries.pro b/model/aux/idl_twist/read_timeseries.pro deleted file mode 100644 index e4e7bcdf6..000000000 --- a/model/aux/idl_twist/read_timeseries.pro +++ /dev/null @@ -1,595 +0,0 @@ -;/ -;/ +-----------------------------------+ -;/ | TWIST Ifremer-SHOM | -;/ | F. Ardhuin | -;/ | IDL command language | -;/ | Last update : 17-Oct-2013 | -;/ +-----------------------------------+ -;/ -;/ Licence information: This code is distributed under the CeCILL license -;/ generally compatible with the Gnu Public Licence (GPL) -;/ http://www.cecill.info/index.en.html -;/ -;/ 17-Oct-2013 : Creation ( version 2.00 ) -; 1. Purpose : -; -; Reads all sorts of time series formats ... -; -; 2. Method : -; -;---------------------------------------------------------------------------- -Pro read_timeseries,modspec,ncidtest,UNIT,I -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple - - -; -; defines data structure -; - modspec={specdata, typ:0, nfband:0, nabin:0, np:0, nvar:0, ntime:0L, $ - nrun:1, f1:ptr_new(), f2:ptr_new(), f:ptr_new(), df:ptr_new(), $ - theta:ptr_new(),dtheta:1.0, $ - plat:ptr_new(), plon:ptr_new(), pdepth:ptr_new(), $ - pU10:ptr_new(), pUdir:ptr_new(), $ - pCurr:ptr_new(), pCurrdir:ptr_new(), $ - pnames:ptr_new(), varnames:ptr_new(), dates: ptr_new(), $ - data:ptr_new(), flags:ptr_new(), path:ptr_new(), filename:ptr_new()} - d={date, y:0, m:0, d:0, h:0, minu:0, s:0.0, zone:0.0, jday:0.0D} - - modspec.nabin=1 - - IF (ncidtest LT 0) THEN BEGIN -; -; in this case this is not a NetCDF file -; - line='TOTO' - READF,unit,line - ts_filetype=1 - typ=0 - n1=0 - n2=0 - n3=0 -; -; If not a number: branches out to bad_num label: should be 2D spectrum -; - ON_IOERROR, bad_num - READS,line,typ - ts_filetype=0 - READF,unit,n1,n2,n3 - nrun=1 - d={date, y:0, m:0, d:0, h:0, minu:0, s:0.0, zone:0.0, jday:0.0D} - modspec.typ=typ - modspec.nfband=n1 - modspec.np=n2 - modspec.nvar=n3 - f1=FLTARR(n1) - f2=f1 - READF,unit,f1,f2 - modspec.f1=ptr_new(f1) - modspec.f2=ptr_new(f2) - f=0.5*(f1+f2) - f(0)=f1(0) - f(n1-1)=f2(n1-1) - df=ABS(f2-f1) - modspec.f=ptr_new(f) - modspec.df=ptr_new(df) - n=REPLICATE(' ',modspec.np) - FMT='(001(A8))' - IF typ LE 1 THEN BEGIN - modspec.nabin=1 - theta=FLTARR(1) - modspec.theta=ptr_new(theta) - ENDIF - STRPUT,FMT,STRING(modspec.np,FORMAT='(I3)'),1 - READF,unit,n,FORMAT=FMT - modspec.pnames=ptr_new(n) - STRPUT,FMT,STRING(modspec.nvar,FORMAT='(I3)'),1 - n=REPLICATE(' ',modspec.nvar) - READF,unit,n,FORMAT=FMT - modspec.varnames=ptr_new(n) - I=0L - y=0 - d=0 - h=0 - m=0 - minu=0 - zone=0. - nt=2600000L/(modspec.nabin*modspec.nfband) - dar=REPLICATE({date},nt) - data=FLTARR(1,modspec.np,modspec.nvar,modspec.nfband,modspec.nabin,nt) -; -; Reads frequency spectra -; - IF (typ EQ 1) THEN BEGIN - vecteur=FLTARR(modspec.nfband) - WHILE NOT EOF(unit) DO BEGIN - READF,unit,y,m,d,h,minu,zone - sec=0 - jday=JULDAY(m,d,y,h,minu,zone) - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=zone ;sec - dar[i].zone=0; zone - dar[i].jday=jday - FOR J=0,modspec.np-1 DO BEGIN - FOR K=0,modspec.nvar-1 DO BEGIN - READF,unit,vecteur - data(0,J,K,*,0,I)=vecteur - ENDFOR - ENDFOR - I=I+1 - ENDWHILE -; -; Reads bulk data -; - ENDIF ELSE BEGIN - vecteur=FLTARR(modspec.nvar) - over=0 - jdayold=0 - WHILE NOT EOF(unit) AND over EQ 0 DO BEGIN - READF,unit,y,m,d,h,minu,zone,vecteur - sec=0 - IF (I MOD 2000 EQ 0) THEN print,I,y,m,d,h,minu,zone - jday=JULDAY(m,d,y,h,minu,zone) - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=zone ;sec - dar[i].zone=0. ;zone - dar[i].jday=jday - data(0,0,*,0,0,I)=vecteur - IF jday LT jdayold THEN over=1 - jdayold=jday - IF modspec.np GT 1 and over EQ 0 THEN BEGIN - FOR J=1,modspec.np-1 DO BEGIN - READF,unit,vecteur - data(0,J,*,0,0,I)=vecteur - ENDFOR - ENDIF - I=I+1 - ENDWHILE - ENDELSE -; -; Reads spectra files (WWATCH ASCII format) -; -bad_num: IF (ts_filetype EQ 1) THEN BEGIN - typ=2 - latdeg=0 - latmin=0. - londeg=0 - lonmin=0. - n1=0 - n2=0 - n3=0 - string1=' ' - string2=' ' - itoto=0 - READS,line,string1,n1,n2,n3,string2,FORMAT='(A23,X,3I6,X,A32)' - nrun=1 - d={date, y:0, m:0, d:0, h:0, minu:0, s:0.0, zone:0.0, jday:0.0D} - modspec.typ=typ - modspec.nfband=n1 - modspec.nabin=n2 - modspec.np=n3 - print,string2 - IF STRMID(string2,0,1) EQ "'" OR STRMID(string2,0,1) EQ '"' THEN BEGIN - modspec.nvar=1 - varn=STRARR(1) - varn(0)='E(,) ' - ENDIF ELSE BEGIN - varnames=STRARR(6) - varnames(0)='E(,) ' - varnames(1)='Sin(,) ' - varnames(2)='Snl(,) ' - varnames(3)='Sds(,) ' - varnames(4)='Sbt(,) ' - varnames(5)='Stot(,) ' - string2=STRCOMPRESS(string2,/REMOVE_ALL) - invar=INTARR(6) - FOR I=0,5 DO BEGIN - if STRMID(string2,I,1) EQ 'T' THEN invar(I)=1 - ENDFOR - modspec.nvar=TOTAL(invar) - varn=STRARR(modspec.nvar) - J=0 - FOR I=0,modspec.nvar-1 DO BEGIN - IF invar(I) THEN BEGIN - varn(J)=varnames(I) - J=J+1 - ENDIF - ENDFOR - ENDELSE - modspec.varnames=ptr_new(varn) - PRINT,'Variables:',modspec.nvar,varn - - f1=FLTARR(modspec.nfband) - df=FLTARR(modspec.nfband) - READF,unit,f1 - df(0)=f1(1)-f1(0) - FOR I=1,modspec.nfband-2 DO BEGIN - df(I)=0.5*(f1(I+1)-f1(I-1)) - ENDFOR - print,'DF:',F1,'##',DF - df(modspec.nfband-1)=f1(modspec.nfband-1)-f1(modspec.nfband-2) - f=f1 - f1=f+0.5*df - f2=f-0.5*df - modspec.f1=ptr_new(f1) - modspec.f2=ptr_new(f2) - f=f1 - df=ABS(f2-f1) - modspec.f=ptr_new(f) - modspec.df=ptr_new(df) - theta=FLTARR(modspec.nabin) - READF,unit,theta - theta=!pi+theta ;plot direction is direction from - modspec.theta=ptr_new(theta) - - nt=24*10*100; *31*6;*8 - n=STRARR(modspec.np) - lats=FLTARR(modspec.np) - lons=FLTARR(modspec.np) - depths=FLTARR(modspec.np) - U10s=FLTARR(modspec.np,nt) - Udirs=FLTARR(modspec.np,nt) - Currs=FLTARR(modspec.np,nt) - Currdirs=FLTARR(modspec.np,nt) - I=0 - y=0 - d=0 - h=0 - m=0 - minu=0 - zone=0. - lat=0. - lon=0. - depth=0. - U10=0. - Udir=0. - Curr=0. - Currdir=0. - - dar=REPLICATE({date},nt) - data=FLTARR(1,modspec.np,modspec.nvar,modspec.nfband,modspec.nabin,nt) - vecteur=FLTARR(modspec.nfband,modspec.nabin) - WHILE NOT EOF(unit) DO BEGIN - READF,unit,y,m,d,h,minu,zone,FORMAT='(I4,2I2,X,3I2)' - sec=0 - print,'Reading spectrum for:',I,y,m,d,h,minu,zone - jday=JULDAY(m,d,y,h,minu,zone) - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=0. - dar[i].zone=zone - dar[i].jday=jday - FOR J=0,modspec.np-1 DO BEGIN - READF,unit,string1,lat,lon,depth,U10,Udir,Curr,Currdir, $ - FORMAT='(X,A10,X,2F7.2,F10.1,F7.2,F6.1,F7.2,F6.1)' - LatLondegtomin,lat,lon,latdeg,latmin,londeg,lonmin,latlonstring - n(J)=string1+'('+latlonstring+')' - lats(J)=lat - lons(J)=lon - depths(J)=depth - U10s(J,I)=U10 - Udirs(J,I)=Udir - Currs(J,I)=Curr - Currdirs(J,I)=Currdir - FOR K=0,modspec.nvar-1 DO BEGIN - READF,unit,vecteur,FORMAT='(7G11.3)' - data(0,J,K,*,*,I)=vecteur - ENDFOR - ENDFOR - I=I+1; - ENDWHILE - - modspec.pnames=ptr_new(n) - modspec.plat=ptr_new(lats) - modspec.plon=ptr_new(lons) - modspec.pdepth=ptr_new(depths) - modspec.pU10=ptr_new(U10s) - modspec.pUdir=ptr_new(Udirs) - modspec.pCurr=ptr_new(Currs) - modspec.pCurrdir=ptr_new(Currdirs) - - ENDIF ; end of bad_num branch - ENDIF ELSE BEGIN -; -; in this case, it is a NetCDF file -; - ncall=NCDF_INQUIRE(ncidtest) - nvars=ncall.NVARS - dimtid=NCDF_DIMID(ncidtest,'time') -; -; Globwave uses 'frequency1d' -; - dimfid=NCDF_DIMID(ncidtest,'frequency') - IF (dimfid LT 0) THEN dimfid=NCDF_DIMID(ncidtest,'frequency1d') - IF (dimfid LT 0) THEN dimfid=NCDF_DIMID(ncidtest,'frequency2d') - dimdid=NCDF_DIMID(ncidtest,'direction') - dimsid=NCDF_DIMID(ncidtest,'station') - dimxid=NCDF_DIMID(ncidtest,'string16') -; - IF (dimtid GE 0 AND dimfid GE 0 and dimdid GE 0) THEN BEGIN -; -; In this case we are reading type 2 time series: (f,theta) spectra -; - NCDF_DIMINQ,ncidtest,dimfid,name1,n1 - NCDF_DIMINQ,ncidtest,dimdid,name1,n2 - NCDF_DIMINQ,ncidtest,dimsid,name1,n3 -; - freqid=NCDF_VARID(ncidtest,'frequency') - dirid =NCDF_VARID(ncidtest,'direction') - Efthid=NCDF_VARID(ncidtest,'Efth') - IF (Efthid EQ -1) THEN Efthid=NCDF_VARID(ncidtest,'efth') ; new variable names ... - timeid=NCDF_VARID(ncidtest,'time') - - modspec.typ=2 - modspec.nfband=n1 - modspec.nabin=n2 - modspec.np=n3 - modspec.nvar=1 - varn=STRARR(1) - varn(0)='E(,) ' - modspec.varnames=ptr_new(varn) - PRINT,'Variables:',modspec.nvar,varn - - f1=FLTARR(modspec.nfband) - df=FLTARR(modspec.nfband) - varid=NCDF_VARID(ncidtest,'frequency') - NCDF_VARGET,ncidtest,varid,f - varid=NCDF_VARID(ncidtest,'frequency1') - NCDF_VARGET,ncidtest,varid,f1 - varid=NCDF_VARID(ncidtest,'frequency2') - NCDF_VARGET,ncidtest,varid,f2 - df=f2-f1 - modspec.f=ptr_new(f) - modspec.f1=ptr_new(f1) - modspec.f2=ptr_new(f2) - modspec.df=ptr_new(df) - theta=FLTARR(modspec.nabin) - varid=NCDF_VARID(ncidtest,'direction') - NCDF_VARGET,ncidtest,varid,theta -; -; Changes direction conventions to "from" -; - NCDF_ATTGET,ncidtest,varid,'units',thetaunits - NCDF_ATTGET,ncidtest,varid,'standard_name',thetaname - IF (STRING(thetaunits) EQ "degree") THEN theta = theta *!dtor - IF (STRING(thetaname) EQ "sea_surface_wave_to_direction") THEN theta=!pi+theta -; - modspec.theta=ptr_new(theta) - NCDF_DIMINQ,ncidtest,dimtid,name1,nt - print,'NC directions converted:',theta,STRING(thetaunits) - n=STRARR(modspec.np) - lats=FLTARR(modspec.np) - lons=FLTARR(modspec.np) - depths=FLTARR(modspec.np) - U10s=FLTARR(modspec.np,nt) - Udirs=FLTARR(modspec.np,nt) - Currs=FLTARR(modspec.np,nt) - Currdirs=FLTARR(modspec.np,nt) - - NCDF_VARGET,ncidtest,timeid,timeNC - NCDF_ATTGET,ncidtest,timeid,'units',timeunits - IF (STRING(timeunits) EQ "days since 1990-01-01T00:00:00Z") THEN BEGIN - jdays = timeNC + julday(1,1,1990,0,0,0) - ENDIF ELSE BEGIN - PRINT,'Unknown reference time:',STRING(timeunits) - RETURN - ENDELSE - dar=REPLICATE({date},nt) - FOR I=0,nt-1 DO BEGIN - dar[i].jday=jdays(I) - CALDAT,jdays(I),m,d,y,h,minu,sec - sec=ROUND(sec) - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=sec - dar[i].zone=0. ;zone - ENDFOR - varid=NCDF_VARID(ncidtest,'station_name') - NCDF_VARGET,ncidtest,varid,n1 - n=STRING(n1) - varid=NCDF_VARID(ncidtest,'latitude') - NCDF_VARGET,ncidtest,varid,lats - varid=NCDF_VARID(ncidtest,'longitude') - NCDF_VARGET,ncidtest,varid,lons - varid=NCDF_VARID(ncidtest,'depth') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'dpt') ; new variable names ... - NCDF_VARGET,ncidtest,varid,depths - varid=NCDF_VARID(ncidtest,'u10m') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'wnd') ; new variable names ... - NCDF_VARGET,ncidtest,varid,U10s - varid=NCDF_VARID(ncidtest,'udir') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'wnddir') ; new variable names ... - NCDF_VARGET,ncidtest,varid,Udirs - varid=NCDF_VARID(ncidtest,'curr') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'cur') ; new variable names ... - NCDF_VARGET,ncidtest,varid,Currs - varid=NCDF_VARID(ncidtest,'currdir') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'curdir') ; new variable names ... - NCDF_VARGET,ncidtest,varid,Currdirs - varid=NCDF_VARID(ncidtest,'currdir') - NCDF_VARGET,ncidtest,Efthid,dataCDF - data=FLTARR(1,modspec.np,modspec.nvar,modspec.nfband,modspec.nabin,nt) - FOR I=0,nt-1 DO BEGIN - FOR J=0,modspec.np-1 DO BEGIN - FOR K=0,modspec.nfband-1 DO BEGIN - data(0,J,0,K,*,I)=dataCDF(*,K,J,I) - ENDFOR - ENDFOR - ENDFOR - I=nt - modspec.pnames=ptr_new(n) - modspec.plat=ptr_new(lats) - modspec.plon=ptr_new(lons) - modspec.pdepth=ptr_new(depths) - modspec.pU10=ptr_new(U10s) - modspec.pUdir=ptr_new(Udirs) - modspec.pCurr=ptr_new(Currs) - modspec.pCurrdir=ptr_new(Currdirs) - NCDF_CLOSE,ncidtest -; - ENDIF ELSE BEGIN IF (dimfid GT 0) THEN BEGIN -; -; In this case we are reading type 1 time series: (f,theta) spectra -; - modspec.typ=1 - modspec.nabin=1 - theta=FLTARR(1) - modspec.theta=ptr_new(theta) - NCDF_DIMINQ,ncidtest,dimfid,name1,n1 - IF (dimsid GT 0) THEN NCDF_DIMINQ,ncidtest,dimsid,name1,n3 ELSE n3=1 - freqid=NCDF_VARID(ncidtest,'frequency') - dirid =NCDF_VARID(ncidtest,'direction') - Efthid=NCDF_VARID(ncidtest,'Efth') - timeid=NCDF_VARID(ncidtest,'time') - modspec.nfband=n1 - modspec.np=n3 - modspec.nvar=1 - varn=STRARR(1) - - f1=FLTARR(modspec.nfband) - df=FLTARR(modspec.nfband) - varid=NCDF_VARID(ncidtest,'frequency') - IF (varid LT 0) THEN $ - varid=NCDF_VARID(ncidtest,'wave_directional_spectrum_central_frequency') - IF (varid LT 0) THEN $ - varid=NCDF_VARID(ncidtest,'wave_frequency_spectrum_central_frequency') - NCDF_VARGET,ncidtest,varid,f - varid=NCDF_VARID(ncidtest,'frequency1') - IF (varid GE 0) THEN BEGIN - NCDF_VARGET,ncidtest,varid,f1 - varid=NCDF_VARID(ncidtest,'frequency2') - NCDF_VARGET,ncidtest,varid,f2 - df=f2-f1 - ENDIF ELSE BEGIN - varid=NCDF_VARID(ncidtest,'frequency') - IF (varid LT 0) THEN $ - varid=NCDF_VARID(ncidtest,'wave_directional_spectrum_frequency_range') - IF (varid LT 0) THEN $ - varid=NCDF_VARID(ncidtest,'wave_frequency_spectrum_frequency_range') - NCDF_VARGET,ncidtest,varid,df - f1=f-df*0.5 - f2=f+df*0.5 - ENDELSE - modspec.f=ptr_new(f) - modspec.f1=ptr_new(f1) - modspec.f2=ptr_new(f2) - modspec.df=ptr_new(df) - varid=NCDF_VARID(ncidtest,'direction') - NCDF_DIMINQ,ncidtest,dimtid,name1,nt - n=STRARR(modspec.np) - lats=FLTARR(modspec.np) - lons=FLTARR(modspec.np) - depths=FLTARR(modspec.np) - U10s=FLTARR(modspec.np,nt) - Udirs=FLTARR(modspec.np,nt) - Currs=FLTARR(modspec.np,nt) - Currdirs=FLTARR(modspec.np,nt) - - NCDF_VARGET,ncidtest,timeid,timeNC - NCDF_ATTGET,ncidtest,timeid,'units',timeunits - CASE STRING(timeunits) OF ; We will do a better jog with this later ;-) - 'days since 1990-01-01T00:00:00Z': jdays = timeNC + julday(1,1,1990,0,0,0) - 'seconds since 1970-01-01 00:00:00': jdays = timeNC/86400. + julday(1,1,1970,0,0,0) - ELSE: PRINT,'Unknown reference time:',STRING(timeunits),'.' - ENDCASE - dar=REPLICATE({date},nt) - zone=0. - FOR I=0,nt-1 DO BEGIN - dar[i].jday=jdays(I) - CALDAT,jdays(I),m,d,y,h,minu,sec - sec=ROUND(sec) - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=0. - dar[i].zone=zone - IF (I EQ 0) THEN print,'Reading spectrum for:',I,y,m,d,h,minu,sec - ENDFOR - print,'Last spectrum for:',I-1,y,m,d,h,minu,sec - - varid=NCDF_VARID(ncidtest,'station_name') - IF (varid EQ -1) THEN NCDF_ATTGET,ncidtest,'wmo_id',n1,/GLOBAL ELSE $ - NCDF_VARGET,ncidtest,varid,n1 - pn=STRARR(1) - pn(0)=STRING(n1) - modspec.pnames=ptr_new(pn) - - varid=NCDF_VARID(ncidtest,'latitude') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'lat') - NCDF_VARGET,ncidtest,varid,lats - - varid=NCDF_VARID(ncidtest,'longitude') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'lon') - NCDF_VARGET,ncidtest,varid,lons - varid=NCDF_VARID(ncidtest,'depth') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'dpt') ; new variable names ... - NCDF_VARGET,ncidtest,varid,depths - varid=NCDF_VARID(ncidtest,'u10m') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'wnd') ; new variable names ... - IF (varid GE 0) THEN NCDF_VARGET,ncidtest,varid,U10s - varid=NCDF_VARID(ncidtest,'udir') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'wnddir') ; new variable names ... - IF (varid GE 0) THEN NCDF_VARGET,ncidtest,varid,Udirs - IF (varid GE 0) THEN varid=NCDF_VARID(ncidtest,'curr') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'cur') ; new variable names ... - IF (varid GE 0) THEN NCDF_VARGET,ncidtest,varid,Currs - IF (varid GE 0) THEN varid=NCDF_VARID(ncidtest,'currdir') - IF (varid EQ -1) THEN varid=NCDF_VARID(ncidtest,'curdir') ; new variable names ... - IF (varid GE 0) THEN NCDF_VARGET,ncidtest,varid,Currdirs - - varid=NCDF_VARID(ncidtest,'ef') - IF (varid EQ -1) THEN $ - varid=NCDF_VARID(ncidtest,'wave_directional_spectrum_spectral_density') - IF (varid EQ -1) THEN $ - varid=NCDF_VARID(ncidtest,'wave_frequency_spectrum_spectral_density') - NCDF_VARGET,ncidtest,varid,dataCDF - IF (varid GE 0) THEN modspec.nvar = 1 - data=FLTARR(1,modspec.np,modspec.nvar,modspec.nfband,modspec.nabin,nt) -; Will add directional stuff later ... - varn=STRARR(1) - varn(0)='Ef ' - modspec.varnames=ptr_new(varn) - PRINT,'Variables:',modspec.nvar,varn - FOR I=0,nt-1 DO BEGIN - FOR J=0,modspec.np-1 DO BEGIN - FOR K=0,modspec.nfband-1 DO BEGIN - data(0,J,0,K,0,I)=dataCDF(K,I) - ENDFOR - ENDFOR - ENDFOR - I=nt - modspec.plat=ptr_new(lats) - modspec.plon=ptr_new(lons) - modspec.pdepth=ptr_new(depths) - modspec.pU10=ptr_new(U10s) - modspec.pUdir=ptr_new(Udirs) - modspec.pCurr=ptr_new(Currs) - modspec.pCurrdir=ptr_new(Currdirs) - NCDF_CLOSE,ncidtest - ENDIF - ENDELSE - ENDELSE - - modspec.ntime=I - modspec.data=ptr_new(data(*,*,*,*,*,0:I-1)) - modspec.dates=ptr_new(dar(0:I-1)) - flags=INTARR(I)+1 - PRINT,'Read ',I,' time steps.' - - modspec.flags=ptr_new(flags) - END diff --git a/model/aux/idl_twist/rt_visumain.pro b/model/aux/idl_twist/rt_visumain.pro deleted file mode 100644 index 5d4aaf33a..000000000 --- a/model/aux/idl_twist/rt_visumain.pro +++ /dev/null @@ -1,8715 +0,0 @@ -;/ -;/ +-----------------------------------+ -;/ | TWIST Ifremer-SHOM | -;/ | F. Ardhuin | -;/ | IDL command language | -;/ | Last update : 30-Nov-2013 | -;/ +-----------------------------------+ -;/ -;/ Licence information: This code is distributed under the CeCILL license -;/ generally compatible with the Gnu Public Licence (GPL) -;/ http://www.cecill.info/index.en.html -;/ -;/ 17-Oct-2013 : Clean up ( version 2.00 ) -;/ 17-Oct-2013 : Reading of GLOBWAVE NetCDF buoy data( version 2.00 ) -;/ 26-Oct-2013 : Manages different times for add. mod( version 2.00 ) -;/ 27-Oct-2013 : ASCII export from NetCDF files ( version 2.00 ) -;/ 10-Nov-2013 : Debugged the update_coordinates ( version 2.00 ) -;/ 30-Nov-2013 : Adding support for polar grids ( version 2.01 ) -; 1. Purpose : -; -; Main GUI for wave analysis. Calls sub-windows. -; -; 2. Method : -; -; - Reads some files -; - Does some processing -; - performs a plot -; -; This files contains the main procedures -; it also calls parametros.pro, raytracer.pro, gridbuild.pro -; -; All the widgets of the main window are defined in 'analyzer' -;---------------------------------------------------------------------------- -Pro rt_visumain -;+ -; NAME: -; ANALYZER -; PURPOSE: -; Displays the widgets of the main window -; CALLING SEQUENCE: -; rt_visumain -; INPUTS:none -; COMMON BLOCKS: See below -; MODIFICATION HISTORY: under construction (1/1/1999 - 17-Oct-2013) -; MODIFICATION HISTORY: increased slider width (17-Oct-2013) -;- -;** 1 ** Display parameters -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON INTERFACE, TWISTVA_VERSION - -;** 2 ** Display and data variables/parameters -COMMON FREQ, freq,nfband,findex,findex2 -COMMON DIR, nabin,nabint,aindex,THETA -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 - -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath - -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -;*******END OF COMMON BLOCKS******************************* - bulktype=0 - scatvar=0 - Initmain ;calls main initialization procedure - YBUTSIZE = 30 - YSLISIZE = 50 - -;controls the device behaviour - device, retain=2, decomposed=0 - - base = long(0) ;main base widget - base = WIDGET_BASE(TITLE='the Wave Ifremer-SHOM tool - v2.0 - rev301', /ROW) - - left = WIDGET_BASE(base,/COLUMN) ; left widget - -; Widget bar on top of drawing window: - topleft = WIDGET_BASE(left, /FRAME, /ROW) - Wtoprow=LONARR(10) - Wtoprow(0)=WIDGET_LABEL(topleft,VALUE='Read file:') - Wtoprow(1)=WIDGET_DROPLIST(topleft, VALUE=[ $ - 'Click here to select file type', $ - 'xyz.dat file', $ - 'Bathy log file', $ - 'Binary bathy', $ - 'GSHHS coastline', $ - '*.line coastline', $ - 'GMESH triangle-based grid', $ - 'Special points (overlays)', $ - 'Transect', $ - ' ', $ - 'Observed time series', $ - 'Modelled time series', $ - 'Additional modelled TS', $ - ' ', $ - 'All modelled TS for new point', $ - ' ', $ - 'Additional bulk time series', $ - 'WW3 NetCDF map', $ - 'GSHHS coast', $ - 'Data flags', $ - 'WW3 map', $ - 'WW3 map diff', $ - 'Color palette']) - IF (TWISTVA_VERSION EQ 'LICENCE') THEN $ - Wtoprow(2)=WIDGET_BUTTON(topleft, VALUE='Palette') $ - ELSE Wtoprow(2)=WIDGET_LABEL(topleft,VALUE=' ') - Wtoprow(3)=WIDGET_BUTTON(topleft, VALUE='Refresh') - Wtoprow(5)=WIDGET_LABEL(topleft,VALUE=' ') - Wtoprow(4)=WIDGET_BUTTON(topleft, VALUE='Quit') - - -; drawing window: - Wdraw = WIDGET_DRAW(left, XSIZE=winx,YSIZE=winy, $ - /BUTTON_EVENTS,/MOTION_EVENTS,SENSITIVE=0, $ - /WHEEL_EVENTS,/COLOR_MODEL,COLORS=256) - - -; Widgets on the right: - - right = WIDGET_BASE(base, /COLUMN) ; right widget - - Wrlines=LONARR(20) - Wright=LONARR(20,15) - Wrblock=LONARR(6) - FOR I=0,5 DO BEGIN - Wrblock(I)=WIDGET_BASE(right, /FRAME, /COLUMN) - ENDFOR - -;first line (part of first block) - I=0 - Wrlines(I)=WIDGET_BASE(Wrblock(0), /ROW) - Wright(I,3)=WIDGET_LABEL(Wrlines(I), VALUE='Time series:', YSIZE=YBUTSIZE) - Wright(I,0)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['Modelled','Observed','Comparison'], YSIZE=YBUTSIZE) - Wright(I,1)=WIDGET_LABEL(Wrlines(I), VALUE='Flags:', YSIZE=YBUTSIZE) - Wright(I,2)=WIDGET_DROPLIST(Wrlines(I), VALUE=['NO CHOICE'], YSIZE=YBUTSIZE) -; -;second line (part of first block) -; - I=2 - Wrlines(I)=WIDGET_BASE(Wrblock(0), /ROW) - ptype = ['Grid+Topo','Bathy from gmsh', 'WW3 map','WW3 map diff'] - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='Other data:') - Wright(I,1)=WIDGET_DROPLIST(Wrlines(I), VALUE=ptype) - Wright(I,2)=WIDGET_BASE(Wrlines(I), /ROW,/NonExclusive) - Wright(I,3)=Widget_Button(Wright(I,2), Value='Norm') - Widget_Control, Wright(I,3), Set_Button=1 -;3rd line (second block) - I=1 - Wrlines(I)=WIDGET_BASE(Wrblock(0), /ROW) - Wright(I,4)=WIDGET_LABEL(Wrlines(I), VALUE='Var.:', YSIZE=YBUTSIZE) - Wright(I,1)=WIDGET_DROPLIST(Wrlines(I), VALUE=['NO CHOICE'], YSIZE=YBUTSIZE) - Wright(I,2)=WIDGET_DROPLIST(Wrlines(I),VALUE=['NO CHOICE'], YSIZE=YBUTSIZE) - Wright(I,3)=WIDGET_DROPLIST(Wrlines(I), VALUE=['NO CHOICE'], YSIZE=YBUTSIZE) - -;4th line (second block) - I=3 - Wrlines(I)=WIDGET_BASE(Wrblock(1), /ROW) - Wright(I,4)=WIDGET_LABEL(Wrlines(I),VALUE='Overlays') - Wright(I,0)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['DIR','NO DIR'], YSIZE=YBUTSIZE) - Wright(I,1)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['NO SYM','SPEC','GP','ALL','GP #'], YSIZE=YBUTSIZE) - Wright(I,2)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['NO BATHY','DOT30-50','SOL300','DASH100','SOL20-40'], YSIZE=25, FRAME = 0) -;5th line (second block) - I=4 - Wrlines(I)=WIDGET_BASE(Wrblock(1), /ROW) - Wright(I,0)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['Coast','No coast','outline','outline, no lakes'], YSIZE=YBUTSIZE) - Wright(I,2)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['NO TRI','TRI','CELLS','NODES']) - Wright(I,3)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['NO','Cont.'], YSIZE=25, FRAME = 0) - -;6th line (3rd block) - I=5 - Wrlines(I)=WIDGET_BASE(Wrblock(2), /ROW) - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='Plot type:') - Wright(I,1)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['CONTOURFILL','TV','POLYFILL','CONTOUR', $ - 'NOTHING','POLAR FILL','POLAR_CONTOUR','POLAR_POLY','SURFACE','SHADE_SURF', $ - 'SHADE_SURF2','LEGO','ONLY CBAR','2D-f spectrum'], YSIZE=YBUTSIZE) - -;7th line (3rd block) - I=6 - Wrlines(I)=WIDGET_BASE(Wrblock(2), /ROW) - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='Output:') - Wright(I,1)=WIDGET_DROPLIST(Wrlines(I),VALUE=['Annotate','Save as PS', $ - 'Send to las1r2','Send to col1r1','Save as EPS','Save as PNG', $ - 'Save as JPEG','Save as TIFF','Save as GIF-M','time-GIF'], YSIZE=YBUTSIZE) - - Wright(I,2)=WIDGET_DROPLIST(Wrlines(I), $ - VALUE=['get time series','Save time series','from all files', $ - 'save from all','Save snapshot'], YSIZE=YBUTSIZE) - -;8th line (4th block) - I=7 - Wrlines(I)=WIDGET_BASE(Wrblock(3), /ROW) - Wright(I,4)=WIDGET_LABEL(Wrlines(I),VALUE='Toolboxes:') - Wright(I,0)=WIDGET_BUTTON(Wrlines(I), VALUE='Plot parameters') - ;Wright(I,1)=WIDGET_BUTTON(Wrlines(I), VALUE='Transect tool') - Wright(I,2)=WIDGET_BUTTON(Wrlines(I), VALUE='Rays') - Wright(I,3)=WIDGET_BUTTON(Wrlines(I), VALUE='Maps') - I=8 - Wright(I,1)=WIDGET_BUTTON(Wrlines(I-1), VALUE='Mesh') - Wright(I,2)=WIDGET_BUTTON(Wrlines(I-1), VALUE='Bathy') - -;9th line (5th block) - I=9 - Wrlines(I)=WIDGET_BASE(Wrblock(4), /ROW) - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='Min/max:') - Wright(I,1)=WIDGET_TEXT(Wrlines(I),/EDITABLE, $ - XSIZE=8,YSIZE=1,VALUE=strcompress(STRING(mindepth))) - ;Wright(I,2)= WIDGET_LABEL(Wrlines(I),VALUE='Max:') - Wright(I,3)= WIDGET_TEXT(Wrlines(I),/EDITABLE, $ - XSIZE=8,YSIZE=1,VALUE=strcompress(STRING(maxdepth))) - -;10th line (5th block) - I=10 - ;Wrlines(I)=WIDGET_BASE(Wrblock(4), /ROW) - Wright(I,0)=WIDGET_BUTTON(Wrlines(I-1), VALUE='Zoom') - Wright(I,1)=WIDGET_BUTTON(Wrlines(I-1), VALUE='Zoom out') - Wright(I,2)=WIDGET_BUTTON(Wrlines(I-1), VALUE='Move') - -;11th line (5th block) - I=11 - Wrlines(I)=WIDGET_BASE(Wrblock(4), /ROW) - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='Point:') - Wright(I,1)=WIDGET_TEXT(Wrlines(I),XSIZE=6,YSIZE=1, $ - VALUE=strcompress(' 1'),/EDITABLE) - Wright(I,3)=WIDGET_DROPLIST(Wrlines(I),VALUE=[' ']) - Wright(I,2)= WIDGET_BUTTON(Wrlines(I),VALUE='PickNew') - Wright(I,4)=WIDGET_BUTTON(Wrlines(I), VALUE='EndMove') - -;12th line (5th block) - I=12 - Wrlines(I)=WIDGET_BASE(Wrblock(4), /ROW) - Wright(I,0) = WIDGET_SLIDER(Wrlines(I), MAXIMUM=nfband, MINIMUM=1, $ - value=findex,TITLE='Min freq index', YSIZE=YSLISIZE) - Wright(I,5) = WIDGET_SLIDER(Wrlines(I), MAXIMUM=nfband, MINIMUM=1, $ - value=nfband,TITLE='Max freq index', YSIZE=YSLISIZE) - Wright(I,1) = WIDGET_SLIDER(Wrlines(I), MAXIMUM=nabin-1, MINIMUM=0, $ - value=aindex,TITLE='angle', YSIZE=YSLISIZE) - Wrlines(I)=WIDGET_BASE(Wrblock(4), /ROW) - Wright(I,2) = WIDGET_SLIDER(Wrlines(I), MAXIMUM=ntime, MINIMUM=1, $ - value=tindex,TITLE='time index start',XSIZE='150', YSIZE=YSLISIZE) - Wright(I,4) = WIDGET_SLIDER(Wrlines(I), MAXIMUM=ntime, MINIMUM=1, $ - value=dtindex,TITLE='time index end',XSIZE='150', YSIZE=YSLISIZE) - -;15th line (6th block) - I=15 - Wrlines(I)=WIDGET_BASE(Wrblock(5), /ROW) - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='Lat,lon:') - Wright(I,1)=WIDGET_TEXT(Wrlines(I),XSIZE=44,YSIZE=1, $ - VALUE=strcompress('???????????? / ????????????')) - -;14th line (6th block) - I=14 - Wrlines(I)=WIDGET_BASE(Wrblock(5), /ROW) - Wright(I,0)=WIDGET_LABEL(Wrlines(I),VALUE='X,Y:') - Wright(I,1)=WIDGET_TEXT(Wrlines(I),XSIZE=17,YSIZE=1, $ - VALUE=strcompress('????????,????????')) - Wright(I,2)= WIDGET_LABEL(Wrlines(I),VALUE='Z:') - Wright(I,3)= WIDGET_TEXT(Wrlines(I),XSIZE=8,YSIZE=1, $ - VALUE=strcompress('???????')) - Wright(I,4)= WIDGET_LABEL(Wrlines(I),VALUE='Value:') - Wright(I,5)= WIDGET_TEXT(Wrlines(I),XSIZE=7,YSIZE=1, $ - VALUE=strcompress('???????')) - - - WIDGET_CONTROL, /REALIZE, base ;make widgets visible - WIDGET_CONTROL, GET_VALUE=drawval, Wdraw - Wdraw_value_update=1 - WSET, drawval - - WIDGET_CONTROL, Wdraw, SENSITIVE=1 - XMANAGER, 'analyzer', /NO_BLOCK,base ;specify event handler -END - - -;----------------------------------------------------------------------------- -PRO Addinpoly,xc,yc,marginx,marginy,x1,y1,x2,y2,xp,yp,add - add=0 - IF (X1 GT xc) THEN BEGIN - IF (X2 GT xc) THEN BEGIN - IF (Y1 GT yc) THEN BEGIN - IF (Y2 LE yc) THEN BEGIN - add=2 - xp=[xc-marginx,xc-marginx] - yp=[yc+marginy,yc-marginy] - ENDIF - ENDIF ELSE BEGIN - IF (Y2 GT yc) THEN BEGIN - add=2 - xp=[xc+marginx,xc+marginx] - yp=[yc-marginy,yc+marginy] - ENDIF - ENDELSE - ENDIF ELSE BEGIN - IF (Y1 GT yc) THEN BEGIN - IF (Y2 GT yc) THEN BEGIN - add=2 - xp=[xc+marginx,xc-marginx] - yp=[yc+marginy,yc+marginy] - ENDIF ELSE BEGIN - add=3 - xp=[xc+marginx,xc-marginx,xc-marginx] - yp=[yc+marginy,yc+marginy,yc-marginy] - ENDELSE - ENDIF ELSE BEGIN - IF (Y2 GT yc) THEN BEGIN - add=3 - xp=[xc+marginx,xc+marginx,xc-marginx] - yp=[yc-marginy,yc+marginy,yc+marginy] - ENDIF ELSE BEGIN - add=2 - xp=[xc+marginx,xc-marginx] - yp=[yc-marginy,yc-marginy] - ENDELSE - ENDELSE - ENDELSE - ENDIF ELSE BEGIN - IF (X2 GT xc) THEN BEGIN - IF (Y1 GT yc) THEN BEGIN - IF (Y2 LE yc) THEN BEGIN - add=2 - xp=[xc-marginx,xc-marginx] - yp=[yc+marginy,yc-marginy] - ENDIF - ENDIF ELSE BEGIN - IF (Y2 GT yc) THEN BEGIN - add=2 - xp=[xc+marginx,xc+marginx] - yp=[yc-marginy,yc+marginy] - ENDIF - ENDELSE - ENDIF ELSE BEGIN - IF (Y1 GT yc) THEN BEGIN - IF (Y2 GT yc) THEN BEGIN - add=2 - xp=[xc+marginx,xc-marginx] - yp=[yc+marginy,yc+marginy] - ENDIF ELSE BEGIN - add=3 - xp=[xc+marginx,xc-marginx,xc-marginx] - yp=[yc+marginy,yc+marginy,yc-marginy] - ENDELSE - ENDIF ELSE BEGIN - IF (Y2 GT yc) THEN BEGIN - add=3 - xp=[xc+marginx,xc+marginx,xc-marginx] - yp=[yc-marginy,yc+marginy,yc+marginy] - ENDIF ELSE BEGIN - add=2 - xp=[xc+marginx,xc-marginx] - yp=[yc-marginy,yc-marginy] - ENDELSE - ENDELSE - ENDELSE - ENDELSE - -END -;----------------------------------------------------------------------------- -PRO ReadDataFile,filename,filetype,widgetaction -;+ -; NAME: ReadDataFile -; PURPOSE: Reads data from file using the format prescribed by datatype -; CALLING SEQUENCE: ReadDataFile,filename,filetype -; where filename is string (without path) and datatype is an integer -; INPUT: filename: string (without path) -; filetype: integer -; COMMON BLOCKS: datainfo,xyz,choices,drawsize,plotvar,widgets,datatype, -; current,smallval,zoomidx,vecprm,prprm,psprm,dlprm,pmprm, -; flags,rotprm,rotarr -;- - -;** 1 ** Display parameters -common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON WGene,Wgrideditor,WG,root -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - -;** 2 ** Display and data variables/parameters -COMMON FREQ, freq,nfband,findex,findex2 -COMMON DIR, nabin,nabint,aindex,THETA -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -COMMON MAPPOLE, XPOLE, YPOLE, SLAT, RE, E2, E -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON TRANSLOC,igpt,thetatrans,gridtmat,transtype - -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri - -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON DIR_STACK, DEPTH, STACK -COMMON ARR8m, nfTom,naTom,TomF,Tomth,OBS8m,MOD8m -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON COAST, coastxy,coastl,coastnp,GSHHSPoly,GSHHSPoint,GSHHSPoly2,GSHHSPoint2 -COMMON DEPTHSTAT,nbind,bindres,HISTD,MEAND,SDEVD -COMMON DIRSPEC, ds,dsnfband,ndir,kdkdth,dsfreq,dstheta,dsdf,dstime,dsntime,ds_timezone -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON TRIANGLE2,nzonetri,zonetri,nzonegp,zonegp,ngpzone,gpzone -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON SOURCE, S0,snabin,sntstep -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON WW3, ww3model,ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path,spec2D,ww3matrix2,ww3dir2,ncid,ncid2,ncivar0,ncivar -COMMON WGene,Wgrideditor,WG,root -COMMON XYZDATA, NXYZ, XYZ -COMMON SHORELINE2, open_boundary -;*******END OF COMMON BLOCKS******************************* - -; FILE TYPES: -; 0 'Ray3.inp', $ general purpose input file -; 1 'Ray3b output', $ output of the RAY3 model -; 2 'Bathy log file', $ log file for the bathymetry -; 3 'Binary bathy', $ binary bathymetry file -; 4 'Coast file', $ coastline file used for overlay on plots: reads a gshhs 2.0 file -; 5 'Grid file', $ model grid positions (x,y, lat,lon) -; 6 'Depth stats', $ depth statistics around grid points -; 7 'GMESH triangle-based grid', $ mesh using GMESH format -; 8 'Transect', $ coordinates of points for transect display -; 9 'Offshore spec.', $ time series of boundary condition -;10 'Model specials', $ -;11 'Observations', $ observed freq. spectra at sites X to I -;12 'Ray3b AtoI', $ model additional output for A to I sites -;13 '8m array OBS', $ observed 8m array spectrum -;14 '8m array MOD']) model 8m array spectrum - - - unit=filetype+1 - CD,'.',CURRENT=cpath - raypath=cpath ; BIG BUG TO BE FIXED -; - IF (filetype NE 17) THEN BEGIN -; -; closes old files and open newly selected file -; - ON_IOERROR, not_OPEN - CLOSE,unit -NOT_OPEN: print,'PATH0:',filetype,paths(filetype) - ON_IOERROR, not_NETCDF - openOK=0 - ncidtest=-1 - ncidtest=NCDF_OPEN(paths(filetype)+filename,/NOWRITE) - openOK=1 -NOT_NETCDF: IF (openOK EQ 0) THEN BEGIN - IF (((filetype EQ 1) OR (filetype EQ 3) $ - OR (filetype EQ 4))) $ ; AND !VERSION.OS_FAMILY EQ 'Windows' ) $ - THEN OPENR,unit,paths(filetype)+filename,/SWAP_ENDIAN $ - ELSE OPENR,unit,paths(filetype)+filename - ENDIF -; - ENDIF ELSE BEGIN - IF N_ELEMENTS(ncid2) EQ 0 THEN BEGIN - IF N_ELEMENTS(ncid) GT 0 THEN NCDF_CLOSE,ncid - ENDIF ELSE BEGIN - IF N_ELEMENTS(ncid) GT 0 AND (ncid NE ncid2) THEN NCDF_CLOSE,ncid - ENDELSE - ncid=NCDF_OPEN(paths(filetype)+filename,/NOWRITE) - ENDELSE - ON_IOERROR, NULL -; -; sets the flag variable to indicate that file is read -; - filestatus(filetype)=filestatus(filetype)+1 - CASE filetype of - - 1:BEGIN ;reads xyz.dat - nxyz=0L - READF,unit,nxyz - XYZ=FLTARR(NXYZ,3) - XYZ1=FLTARR(3) - FOR I=0L,nxyz-1 DO BEGIN - READF,unit,XYZ1 - XYZ(I,*)=XYZ1 - ENDFOR - readOK=1 - lonmin=MIN(XYZ(*,0)) - lonmax=MAX(XYZ(*,0)) - latmin=MIN(XYZ(*,1)) - latmax=MAX(XYZ(*,1)) - UPDATE_COORDINATES,lonmin,lonmax,latmin,latmax,widgetaction - - - FOR I=0L,nxyz-1 DO BEGIN - latdeg=FLOOR(XYZ(I,1)) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(XYZ(I,0)) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(XYZ(I,1)-latdeg)*60. - lonmin=(XYZ(I,0)-londeg)*60. - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - XYZ(I,0)=X - XYZ(I,1)=Y - ENDFOR - END -; -;reads bathy log file -; - 2:BEGIN - nx=0L - ny=0L - toto=0 - MAPLONLAT=1 - READF,unit,rlatmin,rlatmax,rlonmin,rlonmax - readOK=0 - ON_IOERROR, bad_numlog - READF,unit,toto - READF,unit,sx,sy - READF,unit,nx,ny - readOK=1 -bad_numlog: IF (readOK EQ 0) THEN BEGIN - nx=ROUND((rlonmax-rlonmin)*1200)+1 - ny=ROUND((rlatmax-rlatmin)*1200)+1 - sx=(rlonmax-rlonmin)*4E7/360./(nx-1)*cos(0.5*(rlatmax+rlatmin)*!pi/180.) - sy=(rlatmax-rlatmin)*4E7/360./(ny-1) - print,'Automatic setting of nx and ny:',nx,ny - ENDIF - dx=sx/1000. - dy=sy/1000. - nxzmin=0L - nyzmin=0L - nxzmax=nx-1 - nyzmax=ny-1 - rangex=[0,dx*FLOAT(nx-1)] - rangey=[0,dy*FLOAT(ny-1)] - IF widgetaction THEN WIDGET_CONTROL, Wdraw, SENSITIVE=1 - paths(filetype+1)=paths(filetype) - datastatus(3)=0 - END - 3:BEGIN ;reads binary bathymetry file (generated with matlab) - print,'Test NetCDF:',ncidtest - IF (ncidtest LT 0) THEN BEGIN -; -; in this case this is not a NetCDF file -; - gd=FLTARR(ny,nx) - READU,unit,gd - gd=transpose(gd) - ENDIF ELSE BEGIN - varid=NCDF_VARID(ncidtest,'x_range') - NCDF_VARGET,ncidtest,varid,rangex - rlonmin=rangex(0) - rlonmax=rangex(1) - varid=NCDF_VARID(ncidtest,'y_range') - NCDF_VARGET,ncidtest,varid,rangey - rlatmin=rangey(0) - rlatmax=rangey(1) - varid=NCDF_VARID(ncidtest,'dimension') - NCDF_VARGET,ncidtest,varid,dimensions - nx=dimensions(0) - ny=dimensions(1) - varid=NCDF_VARID(ncidtest,'z') - NCDF_VARGET,ncidtest,varid,gd - gd = REFORM(gd, nx, ny, /OVERWRITE) - gd=-1.*REVERSE(gd,2) - sx=(rlonmax-rlonmin)*4E7/360./(nx-1)*cos(0.5*(rlatmax+rlatmin)*!pi/180.) - sy=(rlatmax-rlatmin)*4E7/360./(ny-1) - dx=sx/1000. - dy=sy/1000. - nxzmin=0L - nyzmin=0L - nxzmax=nx/2-1 - nyzmax=ny/2-1 - rangex=[0,dx*FLOAT(nxzmax-1)] - rangey=[0,dy*FLOAT(nyzmax-1)] - IF widgetaction THEN WIDGET_CONTROL, Wdraw, SENSITIVE=1 - datastatus(2)=1 - ENDELSE - END - - 4:BEGIN ; reads a gshhs v2.0 coastline file - ; (cf. www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) - tempoPoly=LONARR(600000,10) - tempoPoint=FLTARR(20000000,2) - ID=0L ;identity number of polygon - NP=0L ; number of points in polygon - LEV=0L ; level (1 land, 2 lake, 3 island in lake ...) - LEVMORE=BYTARR(4) - MW=0L - ME=0L - MS=0L - MN=0L - AREA=0L - FLAG=0L - AREA_FULL=0L - CONTAINER=0L - ANCESTOR=0L - X=0L - y=0L - tempoPoly(0,0)=0 ;pointer to tempoPoint - ; the points of polygon I are stored in - ;tempoPoint(tempoPoly(I,0):tempoPoly(I+1,0)-1) - IC=0L - ; PRINT,'Rlonmax:',rlonmin,rlonmax,rlatmin,rlatmax - marginx=0. - marginy=(rlatmax-rlatmin)*0.2 - rlonminn=rlonmin - IF ((rlonmax-rlonmin) LT 60) THEN BEGIN - marginx=(rlonmax-rlonmin)*0.2 - rlonminn=rlonmin-6.*marginx - ENDIF - xc=(rlonmax+rlonmin)/2. - yc=(rlatmax+rlatmin)/2. - - Outreduced=0 - Outdump=0 - - IF (outdump EQ 1) THEN BEGIN - GET_LUN,unit2 - OPENW,unit2,'GSHHS_v2_fullres_xy_nolakes.txt' - depthcote=-10. - ENDIF - - WHILE NOT EOF(unit) DO BEGIN - READU,unit,ID,NP,LEVMORE,MW,ME,MS,MN,AREA,AREA_FULL,CONTAINER,ANCESTOR ;reads the polygon header - LEV=LONG(LEVMORE(0)) - ;IF (ID LE 100) THEN PRINT,'Np and bounds:',ID,NP,'##',LEV,'##',MW,ME,MS,MN - VECTOR=LONARR(NP*2) - READU,unit,VECTOR - VECTOR=TRANSPOSE(REFORM(VECTOR,2,NP)) - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - tempoPoly(IC,1)=ID - tempoPoly(IC,3)=LEV - tempoPoly(IC,4)=MW - tempoPoly(IC,5)=ME - tempoPoly(IC,6)=MS - tempoPoly(IC,7)=MN - tempoPoly(IC,8)=AREA - tempoPoly(IC,9)=FLAG - -; -; Corrects for West indies shift ... -; - IF (MW GT 298400000 AND ME LT 299400000 AND MS GT 14200000 AND MN LT 15800000) THEN BEGIN - VECTOR(*,0) = VECTOR(*,0) + (0.0055*1E6) - VECTOR(*,1) = VECTOR(*,1) + (0.0033*1E6) - ENDIF - IF (MW GT 298000000 AND ME LT 299400000 AND MS GT 15730000 AND MN LT 16600000) THEN BEGIN - VECTOR(*,0) = VECTOR(*,0) - (0.004*1E6) - VECTOR(*,1) = VECTOR(*,1) - (0.0035*1E6) - ENDIF - ; Dump ASCII file with polygons - IF (outdump EQ 1) THEN BEGIN - IF (LEV EQ 1L) THEN BEGIN - PRINTF,unit2,FORMAT='(2I10)',ID,NP - FOR I=0L,NP-1 DO BEGIN - PRINTF,unit2,FORMAT='(2F11.6)',((FLOAT(VECTOR(I,0))*1.E-6+180.) MOD 360)-180,FLOAT(vectOR(I,1))*1.E-6 ;,depthcote - ENDFOR - ENDIF - ENDIF - - IF (outreduced EQ 1) THEN BEGIN - kountk=0L - X=LONARR(NP) - Y=X - X(*)=VECTOR(*,0) - Y(*)=VECTOR(*,1) - IF (MAPLONLAT LT 2) THEN $ - Keep=WHERE(((((FLOAT(X)*1.E-6+180.) MOD 360.) $ - -rlonmax-marginx-180) LE 0.) AND $ - ((((FLOAT(X)*1.E-6+180.) MOD 360.) $ - -rlonmin+marginx-180) GE 0.) AND $ - ((FLOAT(Y)*1.E-6 $ - -rlatmax-marginy) LE 0.) AND $ - ((FLOAT(Y)*1.E-6 $ - -rlatmin+marginy) GE 0.),kountk) $ - ELSE BEGIN - Keep=X*0+1 - kountk=NP - ENDELSE - - NPO=NP-kountk - NP=kountk - IF kountk GT 0 THEN BEGIN -print,'IC:',kountk - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTOR(Keep,*) - IP1=KEEP(0) - IP2=KEEP(kountk-1) - x2=((VECTOR(IP2,0)*1.E-6+180.) MOD 360.)-180. - y2=VECTOR(IP2,1)*1.E-6 - x1=((VECTOR(IP1,0)*1.E-6+180.) MOD 360.)-180. - y1=VECTOR(IP1,1)*1.E-6 - PRINT,'IC: ',IC,ID,NP,kountk,NPO,NPO+NP,IP1,IP2,x1,x2,y1,y2,xc,yc - - IF (NPO GT 0) THEN BEGIN - IF (ABS(x2-x1) GT ABS(rlonmax-rlonmin)) $ - OR ABS(y2-y1) GT ABS(rlatmax-rlatmin) THEN BEGIN - a=(y1-y2)/(y2*x1-x2*y1) - b=(x2-x1)/(y2*x1-x2*y1) - c=1 - - IF (X2-X1)*(y2-y1) LT 0 THEN BEGIN - IF (a*xc+b*yc+c)*(a*rlonmax+b*rlatmax+c) GT 0 THEN BEGIN - ;tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmax+marginx+360.)*1.E6 - ;tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmax+marginy)*1.E6 - PRINT,'Adding point in polygon (1,1)...' - ENDIF ELSE BEGIN - ;tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmin-marginx+360.)*1.E6 - ;tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmin-marginy)*1.E6 - PRINT,'Adding point in polygon (-1,-1)...' - ENDELSE - ENDIF ELSE BEGIN - IF (a*xc+b*yc+c)*(a*rlonmax+b*rlatmin+c) GT 0 THEN BEGIN - tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmin-marginx+360.)*1.E6 - tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmax+marginy)*1.E6 - PRINT,'Adding point in polygon (-1,1)...' - ENDIF ELSE BEGIN - tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmax+marginx+360.)*1.E6 - tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmin-marginy)*1.E6 - PRINT,'Adding point in polygon (1,-1)...' - ENDELSE - ENDELSE - NP=NP+1 - ENDIF - ENDIF - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - IC=IC+1 - ENDIF - ENDIF ELSE BEGIN - IF (FLOAT(MS)*1.E-6 LT -80. AND MAPLONLAT LE 1) THEN BEGIN - NP=NP+1 - print,'Antarctica:',vectOR(0:1,0) - tempo=vectOR - VECTOR=LONARR(NP,2) - vectOR(0,0)=FIX(rlonmax)*1000000 - vectOR(0,1)=FIX(-90)*1000000 - vectOR(NP-1,0)=FIX(rlonminn)*1000000 - vectOR(NP-1,1)=FIX(-90)*1000000 - - VECTOR(1:NP-2,0:1)=tempo(0:np-3,0:1) - ENDIF - X=FLTARR(NP) - X(*)=FLOAT(VECTOR(*,0)*1.E-6 - rlonminn) - index=WHERE(X EQ 360.,kount) - X(*)=(X MOD 360.) - - IF kount GT 0 THEN X(index)=360. - Index1=WHERE(X LT 0,kount1) - IF kount1 GT 0 THEN X(Index1)=X(Index1)+360. - - ; Looks for wrap around - XP1=SHIFT(X,-1) - Indexch=WHERE(ABS(X-XP1) GT 350.,kountch) - IF ((rlonmax-rlonmin) GT 60) AND (kountch GT 2) AND (MAPLONLAT NE 2) THEN BEGIN - ;PRINT,'Flip:',IC,kountch,Indexch,X(Indexch),XP1(Indexch) - NP2=Indexch(0)+1+NP-1-Indexch(kountch-1) - FOR Iwrap=1,kountch-2,2 DO BEGIN - NP2=NP2+Indexch(Iwrap+1)-Indexch(Iwrap) - ENDFOR - NP3=NP-NP2 - VECTR=FLTARR(NP2,2) - VECTR3=FLTARR(NP3,2) - VECTR(0:Indexch(0),0)=X(0:Indexch(0))-marginx - VECTR(0:Indexch(0),1)=FLOAT(VECTOR(0:Indexch(0),1))*1.E-6-rlatmin - Ip2=Indexch(0)+1 - Iwrap=0 - Ip3=0 - FOR Iwrap=1,kountch-1,2 DO BEGIN - IF (Iwrap LT kountch-1) then BEGIN - VECTR(Ip2:Ip2+Indexch(Iwrap+1)-Indexch(Iwrap)-1,0) $ - =X(Indexch(Iwrap)+1:Indexch(Iwrap+1))-marginx - VECTR(Ip2:Ip2+Indexch(Iwrap+1)-Indexch(Iwrap)-1,1) $ - =FLOAT(VECTOR(Indexch(Iwrap)+1:Indexch(Iwrap+1),1))*1.E-6-rlatmin - Ip2=Ip2+Indexch(Iwrap+1)-Indexch(Iwrap) - ENDIF - VECTR3(Ip3:Ip3+Indexch(Iwrap)-Indexch(Iwrap-1)-1,0) $ - =X(Indexch(Iwrap-1)+1:Indexch(Iwrap))-marginx - VECTR3(Ip3:Ip3+Indexch(Iwrap)-Indexch(Iwrap-1)-1,1) $ - =FLOAT(VECTOR(Indexch(Iwrap-1)+1:Indexch(Iwrap),1))*1.E-6-rlatmin - Ip3=Ip3+Indexch(Iwrap)-Indexch(Iwrap-1) - ENDFOR - VECTR(Ip2:NP2-1,0)=X(Indexch(kountch-1)+1:NP-1)-marginx - VECTR(ip2:NP2-1,1)=FLOAT(VECTOR(Indexch(kountch-1)+1:NP-1,1))*1.E-6-rlatmin - NPold=NP - NP=NP2 - - IF (IP3 GT 3) THEN BEGIN - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTR(*,*) - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - - IC=IC+1 - NP=NP3 - VECTR=VECTR3 - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - tempoPoly(IC,1)=ID - tempoPoly(IC,3)=LEV - tempoPoly(IC,4)=MW - tempoPoly(IC,5)=ME - tempoPoly(IC,6)=MS - tempoPoly(IC,7)=MN - tempoPoly(IC,8)=AREA - tempoPoly(IC,9)=FLAG - ENDIF - - ENDIF ELSE BEGIN - VECTR=FLTARR(NP,2) - VECTR(*,0)=X(*)-6.*marginx - VECTR(*,1)=FLOAT(VECTOR(*,1))*1.E-6 - IF (MAPLONLAT LT 2) THEN VECTR(*,1)=VECTR(*,1)-rlatmin - ENDELSE - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTR(*,*) - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - IC=IC+1 - ENDELSE - - ENDWHILE - IF (outdump EQ 1) THEN BEGIN - CLOSE,unit2 - FREE_LUN,unit2 - ENDIF - Npoly=IC - GSHHSPoly=tempoPoly(0:Npoly,*) - PRINT,'Number of relevant polygons:',IC,GSHHSPoly(Npoly),SIZE(tempoPoint) - PRINT,'Bounds of poly 1:',tempoPoly(0,4:7)*1E-6 - - - GSHHSPoint=tempoPoint(0:GSHHSPoly(Npoly)-1,*) - -;************************************************ -; Outputs a reduced version of the original file - IF (outreduced EQ 1) THEN BEGIN - GET_LUN,unit2 - OPENW,unit2,'gshhs_cal.b' - FOR I=0L,Npoly-1 DO BEGIN - WRITEU,unit2,GSHHSPoly(I,1:9) - NP=GSHHSPoly(I,2) - AR=LONARR(NP,2) - AR(*,*)=GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,*) - WRITEU,unit2,REFORM(TRANSPOSE(AR),NP*2) - ENDFOR - CLOSE,unit2 - FREE_LUN,unit2 - ENDIF -;************************************************ - ; COnverts to kilometers - tempo=GSHHSPOINT - GSHHSPoint=FLTARR(GSHHSPoly(Npoly),2) - IF (MAPLONLAT EQ 1) THEN BEGIN - GSHHSPoint(*,0)=(nx-1)*dx*tempo(*,0)/ABS(rlonmax-rlonmin) - GSHHSPoint(*,1)=(ny-1)*dy*tempo(*,1)/ABS(rlatmax-rlatmin) - ENDIF - IF (MAPLONLAT EQ 2) THEN BEGIN - FOR I=0L,GSHHSPoly(Npoly)-1 DO BEGIN - mapll,xx,yy,tempo(I,1),tempo(I,0),1 - GSHHSPoint(I,0)=xx+XPOLE - GSHHSPoint(I,1)=yy+YPOLE - ENDFOR - ENDIF - END - - - ; reads france.line format - - 5:BEGIN - tempoPoly=LONARR(10000,10) - tempoPoint=FLTARR(2000000,2) - ID=0L ;identity number of polygon - NP=0L ; number of points in polygon - - line=' ' - Outdump=0 - IF (outdump EQ 1) THEN BEGIN - GET_LUN,unit2 - OPENW,unit2,'france_more.line' - ENDIF - READF,unit,line - IF (outdump EQ 1) THEN PRINTF,unit2,line - READF,unit,line - IF (outdump EQ 1) THEN PRINTF,unit2,line - IC=0L - ICORIGIN=0L - ICALL=0L - ALLMULTIPLES=0L - ALLP=0L - WHILE NOT EOF(unit) DO BEGIN - ICALL=ICALL+1L - READF,unit,NP,ICORIGIN - VECTOR=FLTARR(NP,2) - MULTIPLES=0L - FOR I=0L,NP-1 DO BEGIN - READF,unit,LON,LAT - VECTOR(I-MULTIPLES,0)=LON - VECTOR(I-MULTIPLES,1)=LAT - IF (I GT 0) THEN $ - IF (VECTOR(I,0) EQ VECTOR(I-1,0) AND VECTOR(I,1) EQ VECTOR(I-1,1)) $ - THEN MULTIPLES=MULTIPLES+1 - ENDFOR - NP=NP-MULTIPLES - IF (outdump EQ 1) THEN PRINTF,unit2,FORMAT='(2I10)',NP,ICORIGIN - IF (outdump EQ 1) THEN BEGIN - IF (ICALL EQ 2) THEN BEGIN - FOR I=NP-1,0L,-1 DO BEGIN - PRINTF,unit2,FORMAT='(2F13.8)',VECTOR(I,0:1) ;,depthcote - ENDFOR - ENDIF ELSE BEGIN - FOR I=0L,NP-1 DO BEGIN - PRINTF,unit2,FORMAT='(2F13.8)',VECTOR(I,0:1) ;,depthcote - ENDFOR - ENDELSE - ENDIF - ALLP=ALLP+NP - ALLMULTIPLES=ALLMULTIPLES+MULTIPLES - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - tempoPoly(IC,1)=ID - tempoPoly(IC,3)=1 - MW=MIN(VECTOR(*,0)) - ME=MAX(VECTOR(*,0)) - MS=MIN(VECTOR(*,1)) - MN=MAX(VECTOR(*,1)) - tempoPoly(IC,4)=ROUND(1E6*MW) - tempoPoly(IC,5)=ROUND(1E6*ME) - tempoPoly(IC,6)=ROUND(1E6*MS) - tempoPoly(IC,7)=ROUND(1E6*MN) - tempoPoly(IC,8)=0 - tempoPoly(IC,9)=0 - IF (ME GT rlonmin and MW LT rlonmax AND MN GT rlatmin and MS LT rlatmax) THEN BEGIN -; -; Only keeps polygons that are in the area -; - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTOR(0:NP-1,*) - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - IC=IC+1 - ENDIF - ENDWHILE - IF (outdump EQ 1) THEN BEGIN - CLOSE,unit2 - FREE_LUN,unit2 - ENDIF - - Npoly=IC - GSHHSPoly2=tempoPoly(0:Npoly,*) - PRINT,'Number of relevant polygons:',IC,GSHHSPoly2(Npoly) - PRINT,'Number of points and multiples:',ALLP, MULTIPLES - - GSHHSPoint2=tempoPoint(0:GSHHSPoly2(Npoly)-1,*) - - tempo=GSHHSPOINT2 - GSHHSPoint2=FLTARR(GSHHSPoly2(Npoly),2) - GSHHSPoint2(*,0)=(nx-1)*dx*(tempo(*,0)-rlonmin)/ABS(rlonmax-rlonmin) - GSHHSPoint2(*,1)=(ny-1)*dy*(tempo(*,1)-rlatmin)/ABS(rlatmax-rlatmin) - ;print,min(GSHHSPoint2(*,0)),max(GSHHSPoint2(*,0)),min(GSHHSPoint2(*,1)),max(GSHHSPoint2(*,1)) - GSHHSPoint=GSHHSPoint2 - GSHHSPoly=GSHHSPoly2 - END - -; -; Reading mesh with GMSH format -; - 6 :BEGIN - line=' ' - name=line - WHILE NOT EOF(unit) DO BEGIN - READF,unit,line - linec=STRCOMPRESS(line) - itri=0L - CASE STRMID(linec,0,6) OF - '$File ':BEGIN - I=0 - READS,STRMID(line,6,2),I - READS,STRMID(line,8,80),name - filenames(I)=STRCOMPRESS(name,/REMOVE_ALL) - IF !VERSION.OS_FAMILY EQ 'Windows' THEN $ - spos=STRPOS(filenames(I),'\') $ - ELSE spos=STRPOS(filenames(I),'/') - PATHS(I) =STRMID(filenames(I),0,spos+1) - filenopath=STRMID(filenames(I),spos+1, STRLEN(filenames(I))-spos-1) - filenames(I)=filenopath - ReadDataFile,filenames(I),I,1 - END - '$MeshF':BEGIN - READF,unit,line - READF,unit,line - END - '$Nodes':BEGIN - nngp=0L - READF,unit,nngp - IF subwin(0) AND N_ELEMENTS(WG) > 0 THEN $ - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - gridmat=DBLARR(8,nngp) - Ind=0 - lon=0.0d - lat=0.0d - z=0.0 - FOR I=0L,nngp-1 DO BEGIN - READF,unit,Ind,lon,lat,z -; -; Converts decimal degrees to degree , minute and X, Y -; - latdeg=FLOOR(lat) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(lon) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(lat-latdeg)*60. - lonmin=(lon-londeg)*60. - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - gridmat(7,I)=z - ENDFOR - lonmin=MIN(gridmat(4,*)+gridmat(5,*)/60.) - lonmax=MAX(gridmat(4,*)+gridmat(5,*)/60.) - latmin=MIN(gridmat(2,*)+gridmat(3,*)/60.) - latmax=MAX(gridmat(2,*)+gridmat(3,*)/60.) - - UPDATE_COORDINATES,lonmin,lonmax,latmin,latmax,widgetaction - FOR I=0L,nngp-1 DO BEGIN - LatLontoXY,gridmat(2,I),gridmat(3,I),gridmat(4,I),gridmat(5,I),x,y - gridmat(0,I)=x - gridmat(1,I)=y - ENDFOR - IF subwin(0) THEN Displaygrid - READF,unit,line - datastatus(5)=1 - IF N_ELEMENTS(nspecgp) EQ 0 THEN nspecgp=0 - END - '$Eleme':BEGIN - nel=0L - READF,unit,nel - TRIGP0=LONARR(nel+1,4) - CONTOURTEMP=LONARR(NNGP,2) - open_boundary=INTARR(NNGP) - icont=0L - itri=0L - eltype=0 - Ind=0L - Inode=0L - island=0 - ntag=0 - trinodes=LONARR(3) - FOR I=0L,nel-1 DO BEGIN - line=' ' - READF,unit,line - READS,line,Ind,eltype,ntag - IF (I EQ 0) THEN BEGIN - ENDIF - ;IF (I EQ 0) THEN STOP - IF (ntag GT 0) THEN tags=LONARR(ntag) - CASE eltype OF - 15:BEGIN - READS,line,Ind,eltype,ntag,tags,Inode - open_boundary(Inode-1)=ROUND(tags(0)) - IF tags(1) EQ 0 THEN BEGIN - gridmat(6,Inode-1)=1 - ENDIF ELSE BEGIN - gridmat(6,Inode-1)=-1 - island=tags(1) - ENDELSE - CONTOURTEMP(icont,0)=Inode-1 - CONTOURTEMP(icont,1)=gridmat(6,Inode-1) - icont=icont+1L - END -; -; Reads triangle element -; - 2:BEGIN - IF (ntag GT 2) THEN BEGIN - READS,line,Ind,eltype,ntag,tags,trinodes - TRIGP0(ITRI+1,0)=tags(2) - IF tags(2) GT 5 THEN TRIGP0(ITRI+1,0)=5 - ENDIF ELSE BEGIN - READS,line,Ind,eltype,ntag,tags,trinodes - ENDELSE - TRIGP0(ITRI+1,1)=trinodes(0) - TRIGP0(ITRI+1,2)=trinodes(1) - TRIGP0(ITRI+1,3)=trinodes(2) - ITRI=ITRI+1 - END -; - 1:BEGIN - END - ENDCASE - ENDFOR - READF,unit,line -; -; Cleans up contour -; - PRINT,'Number of contour nodes:',icont - IF (icont GT 0) THEN BEGIN - CONTOURLINE=LONARR(icont+2,2) - CONTOURLINE(2:2+icont-1,*)=CONTOURTEMP(0:icont-1,*) - CONTOURLINE(0,0)=2 - CONTOURLINE(1,0)=2+icont-1 - ENDIF -; - ntri=itri - AREATRI=FLTARR(ntri+1,2) - IF (ntri GT 0) THEN BEGIN - TRIGP=LONARR(ntri+1,4) - TRIGP(0:ntri,*)=TRIGP0(0:ntri,*) - FOR I=1L,ntri DO BEGIN - FOR J=0,2 DO BEGIN - I1=TRIGP(I,J+1)-1 - I2=TRIGP(I,((J+1) MOD 3)+1)-1 - I3=TRIGP(I,((J+2) MOD 3)+1)-1 - IF ((I1 NE -1) AND (I2 NE -1) AND (I3 NE -1)) THEN BEGIN - DDX=ABS(gridmat(0,I1)-gridmat(0,I2)) - DDY=ABS(gridmat(1,I1)-gridmat(1,I2)) - SIDEL=SQRT(DDX^2+DDY^2) - IF J EQ 0 THEN BEGIN - AREATRI(I,0)=SIDEL - ENDIF ELSE BEGIN - IF AREATRI(I,0) GT SIDEL THEN AREATRI(I,0)=SIDEL - ENDELSE - ;IF (I MOD 2000) EQ 0 THEN PRINT,'SIDEL:',I,J,I1,I2,I3,AREATRI(I),DDX,DDY,SIDEL - ENDIF - ENDFOR - ENDFOR - MEDTRI=MEDIAN(AREATRI(*,0)) - PRINT,'Number of triangles and median size:',ntri,MEDTRI - PRINT,'Minimum size:', MIN(AREATRI(*,0)) - ;MEDTRI=MEAN(AREATRI(*,0)) - IKOUNT=WHERE(AREATRI(*,0) LT 0.01*MEDTRI,KOUNT) - IF (KOUNT GT 0L) THEN BEGIN - FOR I=0L,KOUNT-1L DO BEGIN - IF (IKOUNT(I) LT NTRI AND IKOUNT(I) GT 0) THEN $ - PRINT,'WARNING SMALL TRIANGLE SIDE:',IKOUNT(I),AREATRI(IKOUNT(I),0),TRANSPOSE(TRIGP(IKOUNT(I),1:3)) $ - ELSE $ - PRINT, 'NO SMALL TRIANGLES:',IKOUNT(I),NTRI - ENDFOR - ENDIF - ENDIF - END - ENDCASE - ENDWHILE - datastatus(6)=1 - IF subwin(0) GT 0 THEN BEGIN - WIDGET_CONTROL,WG(0,3),SET_VALUE=STRCOMPRESS(STRING(nngp)) - WIDGET_CONTROL,WGrideditor(1),TABLE_YSIZE=nngp+1 - ENDIF - ntri=itri - END ; end of GMSH file read -; -;reads grid file with special points (mostly for display purposes) -; - 7:BEGIN - nngptmp=0 ;number of grid points - READF,unit,nngptmp - x=0. - y=0. - ITOTO=1 - IF (nngptmp GT 0) THEN BEGIN - nngp=nngptmp - gridmat=FLTARR(8,nngptmp) - MAKE_CONTOUR - FOR I=1,nngp DO BEGIN - READF,unit,Itoto,x,y,latdeg,latmin,londeg,lonmin - if (londeg LT lonmin) THEN londeg=londeg+360 - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - gridmat(0,I-1)=x - gridmat(1,I-1)=y - gridmat(2,I-1)=latdeg - gridmat(3,I-1)=latmin - gridmat(4,I-1)=londeg - gridmat(5,I-1)=lonmin - ENDFOR - subwin(0)=0 - IF subwin(0) THEN Displaygrid - ENDIF - - ;reads info about special points (modified 10/7/99) - nspecgp=0 - name=' ' - IF NOT EOF(unit) THEN BEGIN - READF,unit,nspecgp - IF (nspecgp GT 0) THEN BEGIN - specmat=FLTARR(13,nspecgp) - specname=STRARR(nspecgp) - vecteur=FLTARR(13) - FOR I=0,(nspecgp-1) DO BEGIN - READF,unit,vecteur,name - latdeg=vecteur(3) - latmin=vecteur(4) - londeg=vecteur(5) - lonmin=vecteur(6) - if (londeg LT lonmin) THEN londeg=londeg+360 - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - vecteur(1)=x - vecteur(2)=y - - specmat(0:12,I)=(vecteur) - specname(I)=STRCOMPRESS(name) -print,'HEY:',I,x,y,specname(I) - ENDFOR - ENDIF - ENDIF - END -; -; reads transect files -; - 8:BEGIN - Ntrans=0 ;number of points in transect - NtransGP=0 - transsym=0 - transsymsize=0. - transline=0 - transthick=0 - READF,unit,Ntrans,NtransGP,transsym,transsymsize,transline,transthick - Strans=FLTARR(Ntrans) - Xtrans=FLTARR(Ntrans) - Ytrans=FLTARR(Ntrans) - Ztrans=FLTARR(Ntrans) - Itrans=INTARR(Ntrans,3) - COtrans=FLTARR(Ntrans,3) - s=0. - x=0. - y=0. - z=0. - i1=0 - i2=0 - i3=0 - co1=0. - co2=0. - co3=0. - FOR I=0,Ntrans-1 DO BEGIN - READF,unit,s,x,y,z,i1,i2,i3,co1,co2,co3 - Strans(I)=s - Xtrans(I)=x - Ytrans(I)=y - Ztrans(I)=z - Itrans(I,0)=i1 - Itrans(I,1)=i2 - Itrans(I,2)=i3 - COtrans(I,0)=co1 - COtrans(I,1)=co2 - COtrans(I,2)=co3 - ENDFOR - Ispectrans=INTARR(Ntransgp) - spectransname=STRARR(Ntransgp) - gridtmat=FLTARR(7,Ntransgp) - vecteur=FLTARR(7) - i1=0 - name=' ' - FOR I=0,Ntransgp-1 DO BEGIN - READF,unit,i1,vecteur,name - Ispectrans(I)=i1 - gridtmat(*,I)=vecteur - spectransname(I)=name - ENDFOR - TransOK=1 - END -; -; reads data time series output -; - 10:BEGIN - - read_timeseries,obs,ncidtest,UNIT,I - - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=I - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=I,SET_VALUE=I - tindex2=I - IF widgetaction THEN BEGIN - findex=1 - findex2=obs.nfband - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=obs.nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=obs.nfband, $ - SET_VALUE=obs.nfband - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=I - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=I,SET_VALUE=I - ENDIF - findex=1 - findex2=obs.nfband - flags=INTARR(I)+1 - obs.flags=ptr_new(flags) - IF widgetaction THEN BEGIN - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=obs.nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=obs.nfband,SET_VALUE=obs.nfband - findex=1 - findex2=obs.nfband - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=I - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=I,SET_VALUE=I - tindex=1L - tindex2=I - ENDIF - END -; -; reads model time series output -; - 11:BEGIN - - read_timeseries,modspec,ncidtest,UNIT,I - - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=I - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=I,SET_VALUE=I - tindex2=I - IF widgetaction THEN BEGIN - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=modspec.nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=modspec.nfband, $ - SET_VALUE=modspec.nfband - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=I - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=I,SET_VALUE=I - ENDIF - findex=1 - findex2=modspec.nfband - print,'findex ...:',findex,findex2 - print,'tindex2:',tindex2,modspec.ntime - paths(filetype+1)=paths(filetype) - paths(filetype+4)=paths(filetype) - pathmod=STRARR(1) - filemod=STRARR(1) - pathmod(0)=paths(filetype) - filemod(0)=filename - modspec.path=ptr_new(pathmod) - modspec.filename=ptr_new(filemod) - print,'SIZE 2:',SIZE(*modspec.data) - END -; -; reads model time series output (new run) -; this assumes the same time step ... -; - 12:IF (N_ELEMENTS(modspec) NE 0) THEN BEGIN - nrun=modspec.nrun - olddata=(*modspec.data) - oldpath=(*modspec.path) - oldfile=(*modspec.filename) - - oldmod = modspec - typ=0 - n1=0 - n2=0 - n3=0 - data=FLTARR(nrun+1,oldmod.np,oldmod.nvar,oldmod.nfband, $ - oldmod.nabin,oldmod.ntime) - - read_timeseries,modspec,ncidtest,UNIT,I - - time1=(*oldmod.dates)[0].jday - time2=(*oldmod.dates)[oldmod.ntime-1].jday - timeold=(*oldmod.dates).jday - timenew=(*modspec.dates).jday - IND=WHERE(timenew GE time1 AND timenew LE time2,kount) - IND2=WHERE(timeold GE timenew(0) ,kount2) - - IF (kount GT 0) THEN BEGIN - data0=(*modspec.data) - I1=IND(0) - data(nrun,*,*,*,*,IND2(0):IND2(0)+kount-1)=data0(0,*,*,*,*,IND) - ENDIF - data(0:nrun-1,*,*,*,*,*)=olddata - modspec=oldmod - modspec.nrun=nrun+1 - - PTR_FREE,modspec.data - modspec.data=ptr_new(data) - data=(*modspec.data) - - - pathmod=STRARR(nrun+1) - filemod=STRARR(nrun+1) - pathmod(0:nrun-1)=oldpath - filemod(0:nrun-1)=oldfile - pathmod(nrun)=paths(filetype) - filemod(nrun)=filename - - print,'Additional model run, assumed same time step, variables, points.' - print,'Number of model runs:',nrun - modspec.path=ptr_new(pathmod) - modspec.filename=ptr_new(filemod) - ENDIF - - - 13:BEGIN - END - - 14:BEGIN ; reads model time series output: new point - oldpath=(*modspec.path) - oldfile=(*modspec.filename) - taille=size(oldpath) - nrun=taille(1) - print,'SIZE:',taille,'##',oldpath+filename - paths(11)=oldpath(0) - ReadDataFile,filename,11,1 - print,'HEY:',0,'##',oldpath(0),filename - FOR irun=1,nrun-1 DO BEGIN - paths(12)=oldpath(irun) - ii=STRSPLIT(filename,'.') - otherfile=oldfile(irun) - jj=STRSPLIT(otherfile,'.') - filename2=strmid(otherfile,jj(0),jj(1)-jj(0)) $ - +strmid(filename,ii(1),strlen(filename)-ii(1)) - print,'HEY:',irun,'##',oldpath(irun),filename2 - ReadDataFile,filename2,12,1 - END - END - - - 19:BEGIN ;data flags for model output and comparison with field data - IF N_ELEMENTS(modspec) NE 0 THEN BEGIN ; model time series output (file type 10) - IF (modspec.ntime NE 0) THEN BEGIN - Imax=modspec.ntime - flags=INTARR(Imax) - I=0 - y=0 - d=0 - h=0 - m=0 - min=0 - zone=0. - sec=0 - flag=1 - I2o=0 - over=0 - totflag=0 - WHILE NOT EOF(unit) AND (over EQ 0) DO BEGIN - READF,unit,y,m,d,h,minu,zone,flag - jday=JULDAY(m,d,y,h,minu,zone) - IF (jday GE (*modspec.dates)[0].jday) $ - AND (jday LE (*modspec.dates)[Imax-1].jday) THEN BEGIN - found=0 - I2=I2o - WHILE (NOT found) AND (I2 LT Imax) DO BEGIN - IF (ABS(((*modspec.dates)[I2].jday+(*modspec.dates)[I2].zone/24.0d) $ - -(jday+zone/24.0d)) LT 0.01) THEN BEGIN - flags(I2)=flag - I2o=I2 - found=1 - totflag=totflag+flag - ENDIF - I2=I2+1 - ENDWHILE - I=I+1 - ;print,y,m,d,h,min,zone,flag - ENDIF - IF (jday GT (*modspec.dates)[Imax-1].jday) THEN over = 0 - ENDWHILE - modspec.flags=ptr_new(flags) - print,'Number of good flags:',totflag - ENDIF - ENDIF - END - - - 17:BEGIN ;reads WW3 NC format - datastatus(20)=1 -; -; Stores old grid -; - IF (N_ELEMENTS(rlonmin) GT 0) THEN BEGIN - rlonminold=rlonmin - rlatminold=rlatmin - rlonmaxold=rlonmax - rlatmaxold=rlatmax - nxold=nx - nyold=ny - ENDIF ELSE BEGIN - rlonminold=0. - rlatminold=-90 - rlonmaxold=360 - rlatmaxold=90 - nxold=0 - nyold=0 - ENDELSE -; -; Gets size of arrays -; - ww3model=' ' - ncall=NCDF_INQUIRE(ncid) - nvars=ncall.NVARS - - dimtid=NCDF_DIMID(ncid,'time') - IF (dimtid GE 0 ) THEN NCDF_DIMINQ,ncid,dimtid,timename,ntime - timeid=NCDF_VARID(ncid,'time') - triid=NCDF_VARID(ncid,'tri') - MAPSTAid=NCDF_VARID(ncid,'MAPSTA') - dimxid=NCDF_DIMID(ncid,'x') - dimyid=NCDF_DIMID(ncid,'y') - IF (dimxid EQ -1) THEN BEGIN - dimxid=NCDF_DIMID(ncid,'longitude') - dimyid=NCDF_DIMID(ncid,'latitude') - END - IF (dimxid EQ -1) THEN BEGIN - dimxid=NCDF_DIMID(ncid,'lon') - dimyid=NCDF_DIMID(ncid,'lat') - END - IF (dimxid NE -1) THEN BEGIN - dimn=dimxid - NCDF_DIMINQ,ncid,dimxid,name1,size1 - NCDF_DIMINQ,ncid,dimxid,name0,size0 - lonid=NCDF_VARID(ncid,'longitude') - latid=NCDF_VARID(ncid,'latitude') - MAPLONLAT=1 -; -; Sets MAPLONLAT = 2 for curvilinear grids -; - ncvar=NCDF_VARINQ(ncid,lonid) - ndimvar=ncvar.NDIMS - IF (ndimvar EQ 2) THEN MAPLONLAT = 2 - - IF (lonid EQ -1) THEN BEGIN - MAPLONLAT=0 - lonid=NCDF_VARID(ncid,'x') - latid=NCDF_VARID(ncid,'y') - ENDIF - - ENDIF ELSE BEGIN -; -; Unstructured case: reads grid positions -; - dimn=NCDF_DIMID(ncid,'node') - dimel=NCDF_DIMID(ncid,'element') - lonid=NCDF_VARID(ncid,'longitude') - latid=NCDF_VARID(ncid,'latitude') - IF (lonid EQ -1) THEN lonid=NCDF_VARID(ncid,'lon') - IF (latid EQ -1) THEN latid=NCDF_VARID(ncid,'lat') - MAPLONLAT=1 - IF (lonid EQ -1) THEN BEGIN - MAPLONLAT=0 - lonid=NCDF_VARID(ncid,'x') - latid=NCDF_VARID(ncid,'y') - ENDIF - NCDF_VARGET,ncid,lonid,lon - NCDF_VARGET,ncid,latid,lat - NCDF_DIMINQ,ncid,dimn,name1,nngp - NCDF_DIMINQ,ncid,dimel,name1,ntri - print,'Number of nodes and triangles:',nngp,ntri - IF (N_ELEMENTS(nspecgp) EQ 0) THEN nspecgp=0 - rlonmin=MIN(lon) - rlatmin=MIN(lat) - rlonmax=MAX(lon) - rlatmax=MAX(lat) - newgrid=1 - dlon=rlonmax-rlonmin - dlat=rlatmax-rlatmin - ww3lon=lon - ww3lat=lat - IF ((ABS(rlonmaxold-rlonmax) GT dlon*0.001) OR (ABS(rlonminold-rlonmin) GT dlon*0.001) OR $ - (ABS(rlatmaxold-rlatmax) GT dlat*0.001) OR (ABS(rlatminold-rlatmin) GT dlat*0.001) ) $ - THEN newgrid=1 ELSE newgrid=0 - IF (N_ELEMENTS(nx) EQ 0 OR newgrid EQ 1) THEN BEGIN - nx=1601 - ny=1601 - datastatus(2)=1 - CASE MAPLONLAT OF - 0: BEGIN - dx=dlon*(1./((nx-1)*1000.)) - dy=dlat*(1./((ny-1)*1000.)) - END - 1: BEGIN - dx=dlon*(40000./((nx-1)*360.)) *cos(0.5*(rlatmin+rlatmax)*!dtor) - dy=dlat*(40000./((ny-1)*360.)) - END - 2: BEGIN - SLAT = 70. - RE = 6378.273 - E2 = .006693883 - PI = 3.141592654 - E = sqrt(E2) - la1=lat(0,0) - lo1=lon(0,0) - mapll,xmin,ymin,la1,lo1,1. - mapll,xmax,ymax,lat(nx-1,ny-1),lon(nx-1,ny-1),1. - dx=(xmax-xmin)*(1./((nx-1)*1000.)) - dy=(ymax-ymin)*(1./((ny-1)*1000.)) - XPOLE=-1.*xmin - YPOLE=-1.*ymin - END - ENDCASE - rangex=[0,dx*FLOAT(nx-1)] - rangey=[0,dy*FLOAT(ny-1)] - ENDIF - WIDGET_CONTROL, Wdraw,SENSITIVE=1 - Wdraw_value_update=1 - gridmat=DBLARR(8,nngp) - FOR I=0L,nngp-1 DO BEGIN - latdeg=FLOOR(lat(I)) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(lon(I)) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(lat(I)-latdeg)*60. - lonmin=(lon(I)-londeg)*60. - IF (MAPLONLAT EQ 1) THEN BEGIN - LatLontoXY,latdeg,latmin,londeg,lonmin,x,y - ENDIF ELSE BEGIN - x=lon(I)-rlonmin - y=lat(I)-rlatmin - ENDELSE - gridmat(0,I)=x - gridmat(1,I)=y - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - ENDFOR - triid=NCDF_VARID(ncid,'tri') - - NCDF_VARGET,ncid,triid,ww3tri - usetri=0 - IF (usetri EQ 1) THEN BEGIN - XGP=gridmat(0,*); - YGP=gridmat(1,*); - TRIANGULATE,XGP,YGP,tri1 - taille=size(tri1) - - ntri1=taille[2] - nngpold=nngp - nngptemp=nngpold+ntri1 - XGPnew=DBLARR(nngptemp) - YGPnew=DBLARR(nngptemp) - XGPnew(0:nngpold-1)=XGP - YGPnew(0:nngpold-1)=YGP - NFOUND=0L - FOR I=0L,ntri DO BEGIN - FOUND=0L - tr0=ww3tri(*,I) ; - tr0S=SORT(tr0) - tr0=tr0(tr0S)-1 - FOR J=0L,ntri1-1 DO BEGIN - tr1=tri1(*,J) ; - tr1S=SORT(tr1) - tr1=tr1(tr1S) - IF (tr0(0) EQ tr1(0) AND tr0(1) EQ tr1(1) AND tr0(2) EQ tr1(2)) THEN BEGIN - FOUND=J - NFOUND=NFOUND+1L - ;print,'FOUND I,J:',I,J,'##',NFOUND,ntri1-ntri,'##',tr0,'##',tr1 - BREAK - ENDIF - ENDFOR - IF (FOUND EQ 0L) THEN BEGIN - XGPnew(nngpold-1+NFOUND)=TOTAL(XGP(tr0))/3. - YGPnew(nngpold-1+NFOUND)=TOTAL(YGP(tr0))/3. - ENDIF - ENDFOR - nngp=nngpold+NFOUND - gridmatold=gridmat - gridmat=DBLARR(8,nngp) - gridmat(*,0:nngp-1)=gridmatold - FOR I=nngp,nngp+NFOUND-1 DO BEGIN - x=XGPnew(I) - y=YGPnew(I) - XYtoLATLON,x,y,latdeg,latmin,londeg,lonmin - gridmat(0,I)=x - gridmat(1,I)=y - gridmat(2,I)=latdeg - gridmat(3,I)=latmin - gridmat(4,I)=londeg - gridmat(5,I)=lonmin - ENDFOR - TRIANGULATE,XGPNew,YGPNew,ww3tri - ENDIF - taille=size(ww3tri) - ntri=taille[2] - TRIGP=LONARR(ntri+1,4) - datastatus(0)=1 - datastatus(6)=1 - TRIGP(1:ntri,1:3)=TRANSPOSE(ww3tri) - TRIGP(*,0)=5 - datastatus(5)=1 - ENDELSE - - ivar=3 - IF (triid NE -1) THEN ivar=4 - IF (MAPSTAid NE -1) THEN ivar=ivar+1 - IF (timeid EQ 3) THEN BEGIN - ivar=ivar+1 - freqid=NCDF_VARID(ncid,'f') - NCDF_VARGET,ncid,freqid,freq - nfband=N_ELEMENTS(freq) - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=nfband - FINDEX2=NFBAND-1 - ENDIF -; -; Gets date strings for first time step -; - IF (timeid GE 0 ) THEN NCDF_VARGET,ncid,timeid,timenow,COUNT=1,OFFSET=0 $ - ELSE timenow=0. - dayi=JULDAY(1,1,1990,0,0,0.) - TimetoDate,dayi,timenow*60*24,ww3date,ww3time -; -; Case of structured grids -; - IF (triid EQ -1) THEN BEGIN - NCDF_VARGET,ncid,lonid,ww3lon - NCDF_VARGET,ncid,latid,ww3lat - rlonmin=min(ww3lon) - rlonmax=max(ww3lon) - rlatmin=min(ww3lat) - rlatmax=max(ww3lat) -print,'HEYM:',MAPLONLAT - IF (MAPLONLAT EQ 0) THEN BEGIN - rlonmax=(rlonmax-rlonmin)*360./4E7 - rlonmin=0 - rlatmax=(rlatmax-rlatmin)*360./4E7 - rlatmin=0 - dlon=rlonmax/1000 - dlat=rlatmax/1000 - ENDIF - taille=size(ww3lon) - nx=taille(1) - taille=size(ww3lat) - ny=taille(1) - gridvarids=FLTARR(nvars) - igrids=0 - - varnamel=0 - igrids=0 - FOR I=0,nvars-1 DO BEGIN - ncvar=NCDF_VARINQ(ncid,I) - ndimvar=ncvar.NDIMS - FOR J=0,ndimvar-1 DO BEGIN - IF (ncvar.DIM(J) EQ dimxid AND ncvar.NDIMS GT 1 $ - AND ncvar.name NE 'MAPSTA' and ncvar.name NE 'longitude' $ - AND ncvar.name NE 'latitude' ) THEN BEGIN - gridvarids(igrids)=I - igrids=igrids+1 - IF (STRLEN(ncvar.name) GT varnamel) THEN varnamel=STRLEN(ncvar.name) - ENDIF - ENDFOR - ENDFOR - ncivar=gridvarids(0) - ncivar0=ncivar - ncvar=NCDF_VARINQ(ncid,ncivar) - ndimvar=ncvar.NDIMS -; - CASE ndimvar OF - 2: BEGIN - NCDF_VARGET,ncid,ivar,ww3m,COUNT=[nx,ny],OFFSET=[0,0] - END - 3: BEGIN - NCDF_VARGET,ncid,ivar,ww3m,COUNT=[nx,ny,1],OFFSET=[0,0,0] - END - 4: BEGIN - NCDF_VARGET,ncid,ivar,ww3m,COUNT=[nx,ny,1,1],OFFSET=[0,0,findex-1,0] - END - ELSE: print,'Problem with number of dimensions:',ndimvar - ENDCASE - - - - ENDIF ELSE BEGIN - - - gridvarids=FLTARR(nvars) - igrids=0 - - varnamel=0 - igrids=0 - FOR I=0,nvars-1 DO BEGIN - ncvar=NCDF_VARINQ(ncid,I) - ndimvar=ncvar.NDIMS - FOR J=0,ndimvar-1 DO BEGIN - IF (ncvar.DIM(J) EQ dimn AND ncvar.NDIMS GT 1 AND ncvar.name NE 'MAPSTA' ) THEN BEGIN - gridvarids(igrids)=I - igrids=igrids+1 - IF (STRLEN(ncvar.name) GT varnamel) THEN varnamel=STRLEN(ncvar.name) - ENDIF - ENDFOR - ENDFOR - ivar=gridvarids(0) - ncivar=gridvarids(0) - ncivar0=ncivar - ncvar=NCDF_VARINQ(ncid,ncivar) - ndimvar=ncvar.NDIMS -; - CASE ndimvar OF - 1: BEGIN - NCDF_VARGET,ncid,ivar,ww3m,COUNT=[nngp],OFFSET=[0] - END - 2: BEGIN - NCDF_VARGET,ncid,ivar,ww3m,COUNT=[nngp,1],OFFSET=[0,0] - END - 3: BEGIN - NCDF_VARGET,ncid,ivar,ww3m,COUNT=[nngp,1,1],OFFSET=[0,findex-1,0] - END - ELSE: print,'Problem with number of dimensions:',ndimvar - ENDCASE - - - ENDELSE - -; -; Defines all gridded variable names -; - names=STRARR(igrids) - FOR I=0,igrids-1 DO BEGIN - ivar=gridvarids(I) - ncvar=NCDF_VARINQ(ncid,ivar) - names(I)=ncvar.name - ENDFOR - print,'Variables in NetCDF file:' - print,TRANSPOSE(names) - - WIDGET_CONTROL,Wright(1,1),SET_VALUE=STRCOMPRESS(names) - - - newgrid=0 - dlon=rlonmax-rlonmin - dlat=rlatmax-rlatmin - IF (ABS(rlonmaxold-rlonmax) GT dlon*0.001 OR ABS(rlonminold-rlonmin) GT dlon*0.001 OR $ - ABS(rlatmaxold-rlatmax) GT dlat*0.001 OR ABS(rlatminold-rlatmin) GT dlat*0.001 OR $ - nxold NE nx OR nyold NE ny ) THEN newgrid=1 - - - - ivar=gridvarids(0) - var3=NCDF_VARINQ(ncid,ivar) - attOK=NCDF_ATTINQ(ncid,ivar,'scale_factor') - IF (attOK.Length GT 0) THEN NCDF_ATTGET,ncid,ivar,'scale_factor',ww3scale $ - ELSE ww3scale=1. - NCDF_ATTGET,ncid,ivar,'_FillValue',ww3miss - NCDF_ATTGET,ncid,ivar,'units',ww3unit - - - Index=WHERE(ww3m EQ ww3miss,kount) - ; ww3m=TRANSPOSE(ww3m) - - var3=NCDF_VARINQ(ncid,ncivar) - - IF STRPOS(var3.name,'fp') GT -1 THEN BEGIN - ww3m=1./(ww3m*ww3scale ) - var3.name='Tp' - ENDIF ELSE ww3m=ww3m*ww3scale - IF (kount GT 0) THEN ww3m(index)=-2.*maxval - - - IF (igrids GT 1) THEN BEGIN - IF (triid EQ -1) THEN $ - NCDF_VARGET,ncid,ivar+1,ww3m2,COUNT=[nx,ny,1],OFFSET=[0,0,0] $ - ELSE NCDF_VARGET,ncid,ivar+1,ww3m2,COUNT=[nngp,1],OFFSET=[0,0] - ww3m2=ww3m2*ww3scale - ww3dir=90.-ATAN(-ww3m2,-WW3M)/!dtor ; 90- transforms into trig direction - CASE var3.name OF - 'Fp2(k)': - 'mssx': BEGIN - WW3M=WW3M+WW3M2 - var3.name='mss' - END - 'utaw': BEGIN - WW3M=sqrt(ww3m^2+ww3M2^2) - var3.name='taw' - END - 'utwo': BEGIN - WW3M=sqrt(ww3m^2+ww3M2^2) - var3.name='two' - END - ELSE: WW3M=sqrt(ww3m^2+ww3M2^2) - ENDCASE - - IF (kount GT 0) THEN ww3dir(index)=-2.*maxval - ENDIF - - ww3fieldname = var3.name+' ('+STRING(ww3unit)+')' - PRINT,'Array:',ww3fieldname,size(ww3m) - IF STRPOS(var3.name,'th') GT -1 OR var3.name EQ 'dir' $ - OR var3.name EQ 'dp ' OR ww3fieldname EQ '.pth' THEN BEGIN - ww3dir=ww3m; - ncid2=ncid - ENDIF - IF (newgrid EQ 1) THEN BEGIN - nxzmin=0 - nyzmin=0 - nxzmax=nx-1 - nyzmax=ny-1 - ENDIF - - CASE MAPLONLAT OF - 0: BEGIN - dx=(rlonmax-rlonmin)*(1./((nx-1)*1000.)) - dy=(rlatmax-rlatmin)*(1./((ny-1)*1000.)) - END - 1: BEGIN - dx=(rlonmax-rlonmin)*(40000./((nx-1)*360.)) *cos(0.5*(rlatmin+rlatmax)*!dtor) - dy=(rlatmax-rlatmin)*(40000./((ny-1)*360.)) -print,'HEYMAA:',MAPLONLAT,dx,dy,nx,ny,rlatmin,rlatmax - END - 2: BEGIN - SLAT = 70. - RE = 6378.273 - E2 = .006693883 - PI = 3.141592654 - E = sqrt(E2) - la1=ww3lat(0,0) - lo1=ww3lon(0,0) - mapll,xmin,ymin,la1,lo1,1. - mapll,xmax,ymax,ww3lat(nx-1,ny-1),ww3lon(nx-1,ny-1),1. - XPOLE=-1.*xmin - YPOLE=-1.*ymin - dx=(xmax-xmin)*(1./((nx-1))) - dy=(ymax-ymin)*(1./((ny-1))) - END - ENDCASE - - rangex=[0,dx*FLOAT(nx-1)] - rangey=[0,dy*FLOAT(ny-1)] - WIDGET_CONTROL, Wdraw,SENSITIVE=1 - Wdraw_value_update=1 - dtindex=1 - ww3matrix=ww3m - tindex=1L - tindex2=ntime - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=ntime - ; WIDGET_CONTROL,Wright(12,3),SET_SLIDER_MAX=1 - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=ntime,SET_VALUE=ntime - - gridvarids=FLTARR(nvars) - igrids=0 - FOR I=0,nvars-1 DO BEGIN - ncvar=NCDF_VARINQ(ncid,I) - ndimvar=ncvar.NDIMS - FOR J=0,ndimvar-1 DO BEGIN - IF (ncvar.DIM(J) EQ timeid) THEN BEGIN - gridvarids(igrids)=J - igrids=igrids+1 - ENDIF - ENDFOR - ENDFOR - ncivar=ivar - END -; -; WWATCH ASCII output -; - 20:BEGIN ;WAVEWATCH III transfer file (see WW3 manual) for IDLA=3 - IF n_elements(ww3fieldname) EQ 0 THEN ww3fieldname=" " - ww3fieldname=" " - ww3fieldname0=ww3fieldname - ww3model=' ' - ww3date=' ' - ww3time=' ' - ww3scale=1. - ww3unit='m' - ww3check=0 - toto=0 - toto2=0 - totof="(1X,20I6)" - nx=0L - ny=0L - line=' ' - READF,unit,line - ww3model=STRMID(line,1,13) - ww3date=STRMID(line,15,9) - ww3time=STRMID(line,24,7) - pos1=STRPOS(line,'(') - pos2=STRPOS(line,')') - pos3=STRPOS(line,'.',STRLEN(line)-40,/REVERSE_SEARCH) - taille=size(line) - READS,STRMID(line,31,STRLEN(line)-31),rlonmin,rlonmax,nx, $ - rlatmin,rlatmax,ny - READS,STRMID(line,pos3,STRLEN(line)-pos3),ww3fieldname,ww3scale, $ - ww3unit,toto,toto2,FORMAT='(A4,F8.2,1X,A10,2I2)' - ;ww3fieldname,ww3scale,ww3unit,toto,toto2 - READS,STRMID(line,pos1,pos2-pos1+1), totof - READS,STRMID(line,pos2+1,STRLEN(line)-pos2-1), ww3miss - IF (POS3 LT 83) THEN BEGIN -; -; file coordinates are lat and lon -; - MAPLONLAT=1 - IF(abs(rlonmax-rlonmin)+abs(rlatmax-rlatmin) GT 1000.) THEN BEGIN - rlonmax=(rlonmax-rlonmin)/1000.*(360/40000.) - rlonmin=0. - rlatmax=(rlatmax-rlatmin)/1000.*(360/40000.) - rlatmin=0. - rlatmax=rlatmax*0.5 - rlatmin=-rlatmax - ENDIF - ww3lat=FINDGEN(ny)*(rlatmax-rlatmin)+rlatmin - IF (rlonmin GE 180 AND rlonmax GE 180) THEN BEGIN - rlonmin=rlonmin-360 - rlonmax=rlonmax-360 - ENDIF - - ENDIF ELSE BEGIN -; -; file coordinates are X and Y -; - MAPLONLAT=0 - dlon=(rlonmax-rlonmin)*360./4E7 - dlat=(rlatmax-rlatmin)*360./4E7 - rlonmin=0 - rlonmax=dlon - rlatmin=0 - rlatmax=dlat - ENDELSE - - - ; This format is for Wavewatch version 1.18 - ; FORMAT='(1X,A13,I9.8,I7.6,2(2F8.2,I4),1X,A4,F8.4,1X,A10,2I2,1X,A11,I4)' - ; This format is for Wavewatch version 2.22 - ; FORMAT='(1X,A13,I9.8,I7.6,2(2F8.2,I4),1X,A4,F8.2,1X,A10,2I2,1X,A11,I4)' - - ww3m=FLTARR(nx,ny) - vectora=STRARR(nx) - vector=FLTARR(nx) - totofa=totof - STRPUT,totofa,'A',6 - IF (ww3check EQ 1) THEN BEGIN - FOR J=0,ny-1 DO BEGIN - IF (toto2 EQ 2) THEN $ - READF,unit,vectora,FORMAT=totofa $ - ELSE READF,unit,vectora - FOR K=0,nx-1 DO BEGIN - IF vectora(K) EQ '****' THEN vector(K)=ww3miss $ - ELSE vector(K)=FLOAT(vectora(K)) - ENDFOR - ww3m(*,ny-J-1)=vector - ENDFOR - ENDIF ELSE BEGIN - FOR J=0,ny-1 DO BEGIN - IF (toto2 EQ 2) THEN $ - READF,unit,vector,FORMAT=totofa $ - ELSE READF,unit,vector - ww3m(*,ny-J-1)=vector - ENDFOR - ENDELSE - Index=WHERE(ww3m LE ww3miss,kount) - ww3m=ww3m*ww3scale -; -; Reads a two component vector -; - IF (ww3fieldname EQ '.cur') OR (ww3fieldname EQ '.wnd')$ - OR (ww3fieldname EQ '.uss') OR (ww3fieldname EQ '.tus') THEN BEGIN - ww3m2=FLTARR(nx,ny) - IF (ww3check EQ 1) THEN BEGIN - FOR J=0,ny-1 DO BEGIN - IF (toto2 EQ 2) THEN $ - READF,unit,vectora,FORMAT=totofa $ - ELSE READF,unit,vectora - FOR K=0,nx-1 DO BEGIN - IF vectora(K) EQ '****' THEN vector(K)=ww3miss $ - ELSE vector(K)=FLOAT(vectora(K)) - ENDFOR - ww3m2(*,ny-J-1)=vector - ENDFOR - ENDIF ELSE BEGIN - - FOR J=0,ny-1 DO BEGIN - IF (toto2 EQ 2) THEN $ - READF,unit,vector,FORMAT=totof $ - ELSE READF,unit,vector - ww3m2(*,ny-J-1)=vector - ENDFOR - ENDELSE - ww3m2=ww3m2*ww3scale - ww3dir=90.-ATAN(-ww3m2,-WW3M)/!dtor ;90- transforms into trig direction - WW3M=SQRT(ww3m^2+ww3M2^2) - IF (kount GT 0) THEN ww3dir(index)=2.*maxval - ENDIF - ; - ; - ; - IF (kount GT 0) THEN ww3m(index)=-2.*maxval - IF ww3fieldname EQ '.1th' OR ww3fieldname EQ '.dir' OR ww3fieldname EQ '.dp ' $ - OR ww3fieldname EQ '.pth' THEN BEGIN - ww3dir=ww3m - IF (ww3fieldname0 EQ ' ') THEN ww3matrix=ww3m - ENDIF ELSE ww3matrix=ww3m - CASE ww3fieldname OF - '.dpt':ww3fieldname = 'Depth ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.hs ':ww3fieldname = 'Hs ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.1hs ':ww3fieldname = 'Hs swell 1 ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.phs':ww3fieldname = 'Hs partition('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.hsw':ww3fieldname = 'Hs wind sea ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.fp ':ww3fieldname = 'Tp (s)' - '.dir':IF (ww3fieldname0 EQ ' ') THEN ww3fieldname = 'Direction ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.dp' :IF (ww3fieldname0 EQ ' ') THEN ww3fieldname = 'Direction ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.wnd':ww3fieldname = 'Wind ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.cur':ww3fieldname = 'Courant ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - '.uss':ww3fieldname = 'Surface Stokes drift ('+STRCOMPRESS(ww3unit,/REMOVE_ALL)+')' - ELSE: - ENDCASE - ; This is for structured grids only (unstructured: ny=1) - IF (ny GT 1) THEN BEGIN - nxzmin=0 - nyzmin=0 - nxzmax=nx-1 - nyzmax=ny-1 - dx=(rlonmax-rlonmin)*(40000./((nx-1)*360.))*cos(0.5*(rlatmin+rlatmax)*!dtor) - dy=(rlatmax-rlatmin)*(40000./((ny-1)*360.)) - rangex=[0,dx*FLOAT(nx-1)] - rangey=[0,dy*FLOAT(ny-1)] - WIDGET_CONTROL, Wdraw,SENSITIVE=1 - Wdraw_value_update=1 - ENDIF ELSE BEGIN - nxzmin=0 - nyzmin=0 - nx=FLOOR(sqrt(nx)) - ny=nx - nxzmax=nx-1 - nyzmax=ny-1 - dx=(rlonmax-rlonmin)*(40000./((nx-1)*360.))*cos(0.5*(rlatmin+rlatmax)*!dtor) - dy=(rlatmax-rlatmin)*(40000./((ny-1)*360.)) - rangex=[0,dx*FLOAT(nx-1)] - rangey=[0,dy*FLOAT(ny-1)] - WIDGET_CONTROL, Wdraw, SENSITIVE=0 - Wdraw_value_update=0 - ENDELSE - END - - 21:BEGIN ;Wavewatch III transfer file (see WW3 manual) for IDLA=3 - ww3matrixold=ww3matrix - IF N_ELEMENTS(ww3dir) THEN ww3dirold=ww3dir - tempopath=paths(20) - paths(20)=paths(21) - ReadDataFile,filenames(21),20,1 - paths(20)=tempopath - PRINT,'name:',paths(21),filenames(21) - ww3matrix2=ww3matrix - IF N_ELEMENTS(ww3dir) THEN ww3dir2=ww3dir - ww3matrix=ww3matrixold - IF N_ELEMENTS(ww3dir) THEN ww3dir=ww3dirold - END - -; - 16:BEGIN ;reads extra time series for spectral analysis vs bulk parameters - reference_data_present=0 - IF N_ELEMENTS(modspec) NE 0 THEN BEGIN ; model time series output (file type 10) - IF (modspec.ntime NE 0) THEN BEGIN - reference_data=modspec - reference_data_present=1 - ENDIF - ENDIF - IF N_ELEMENTS(obs) NE 0 THEN BEGIN ; model time series output (file type 10) - IF (obs.ntime NE 0) THEN BEGIN - reference_data=obs - reference_data_present=1 - ENDIF - ENDIF - ;print,(*modspec.dates)[0].jday,modspec.ntime,FORMAT='(f16.4)' - typ=0 - n1=0 - n2=0 - n3=0 - READF,unit,typ - IF (typ EQ 0 AND reference_data_present NE 0) THEN BEGIN - READF,unit,n1,n2,n3 - - obs2={specdata, typ:0, nfband:0, nabin:0, np:0, nvar:0, ntime:0L, $ - nrun:1, f1:ptr_new(), f2:ptr_new(), f:ptr_new(), df:ptr_new(), $ - theta:ptr_new(),dtheta:1.0, $ - plat:ptr_new(), plon:ptr_new(), pdepth:ptr_new(), $ - pU10:ptr_new(), pUdir:ptr_new(), $ - pCurr:ptr_new(), pCurrdir:ptr_new(), $ - pnames:ptr_new(), varnames:ptr_new(), dates: ptr_new(), $ - data:ptr_new(), flags:ptr_new(), path:ptr_new(), filename:ptr_new()} - d={date, y:0, m:0, d:0, h:0, minu:0, s:0.0, zone:0.0, jday:0.0D} - obs2.typ=typ - obs2.nfband=n1 - obs2.np=n2 - obs2.nvar=n3 - f1=FLTARR(n1) - f2=f1 - READF,unit,f1,f2 - df=ABS(f2-f1) - obs2.f1=ptr_new(f1) - obs2.f2=ptr_new(f2) - f=f1*0. - f(0)=f1(0) - f(n1-1)=f2(n1-1) - FOR J=1,n1-2 DO BEGIN - f(J)=f(J-1)+0.5*(df(J-1)+df(J)) - ENDFOR - df=ABS(f2-f1) - obs2.f=ptr_new(f) - obs2.df=ptr_new(df) - IF typ LE 1 THEN BEGIN - obs2.nabin=1 - theta=FLTARR(1) - obs2.theta=ptr_new(theta) - ENDIF - n=REPLICATE(' ',obs2.np) - FMT='(001(A8))' - STRPUT,FMT,STRING(obs2.np,FORMAT='(I3)'),1 - READF,unit,n,FORMAT=FMT - obs2.pnames=ptr_new(n) - STRPUT,FMT,STRING(obs2.nvar,FORMAT='(I3)'),1 - n=REPLICATE(' ',obs2.nvar) - READF,unit,n,FORMAT=FMT - obs2.varnames=ptr_new(n) - print,'Variables:',*obs2.varnames - I=0L - y=0 - d=0 - h=0 - m=0 - minu=0 - zone=0. - ntmax=900000L/(obs2.nabin*obs2.nfband) - dar=REPLICATE({date},ntmax) - Imax=reference_data.ntime-1 - data=FLTARR(1,obs2.np,obs2.nvar,obs2.nfband,obs2.nabin,ntmax) - vecteur=FLTARR(obs2.nvar) - over=0 - WHILE NOT EOF(unit) AND (over EQ 0) DO BEGIN - READF,unit,y,m,d,h,minu,zone,vecteur - ;IF (I LT 12) THEN print,'temps:',I,y,m,d,h,minu,zone,vecteur(7),vecteur(10) - sec=0 - jday=JULDAY(m,d,y,h,minu,zone) - IF (jday GE (*reference_data.dates)[0].jday) $ - AND (jday LE (*reference_data.dates)[Imax].jday) THEN BEGIN - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=zone ;sec - dar[i].zone=0. ;zone - dar[i].jday=jday - data(0,0,*,0,0,I)=vecteur - IF obs2.np GT 1 THEN BEGIN - - FOR J=1,obs2.np-1 DO BEGIN - READF,unit,vecteur - data(0,J,*,0,0,I)=vecteur - ENDFOR - ;print,I,y,m,d,h,min,zone - ENDIF - I=I+1 - ENDIF ELSE BEGIN - FOR J=1,obs2.np-1 DO BEGIN - READF,unit,vecteur - ENDFOR - ENDELSE - IF (jday GT (*reference_data.dates)[Imax].jday) THEN over=1 - ENDWHILE - - obs2.ntime=I - IF (I GT 0) THEN BEGIN - obs2.data=ptr_new(data(*,*,*,*,*,0:I-1)) - obs2.dates=ptr_new(dar(0:I-1)) - flags=INTARR(I)+1 - obs2.flags=ptr_new(flags) - ENDIF ELSE BEGIN - PRINT,'No data in common time range.' - ENDELSE - PRINT,'Read ',I,' time steps.' - ENDIF - END - - - 18:BEGIN ; reads a gshhs file - ; (cf. www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) - tempoPoly=LONARR(600000,10) - tempoPoint=FLTARR(20000000,2) - ID=0L ;identity number of polygon - NP=0L ; number of points in polygon - LEV=0L ; level (1 land, 2 lake, 3 island in lake ...) - MW=0L - ME=0L - MS=0L - MN=0L - AREA=0L - FLAG=0L - X=0L - y=0L - tempoPoly(0,0)=0 ;pointer to tempoPoint - ; the points of polygon I are stored in - ;tempoPoint(tempoPoly(I,0):tempoPoly(I+1,0)-1) - IC=0L - ;PRINT,rlonmin,rlonmax,rlatmin,rlatmax - marginx=0. - marginy=(rlatmax-rlatmin)*0.2 - rlonminn=rlonmin - IF ((rlonmax-rlonmin) LT 60) THEN BEGIN - marginx=(rlonmax-rlonmin)*0.2 - rlonminn=rlonmin-6.*marginx - ENDIF - xc=(rlonmax+rlonmin)/2. - yc=(rlatmax+rlatmin)/2. - - Outreduced=0 - - ;GET_LUN,unit2 - ;OPENW,unit2,'traitcote_gshhs.dat' - ;depthcote=-10. - - WHILE NOT EOF(unit) DO BEGIN - READU,unit,ID,NP,LEV,MW,ME,MS,MN,AREA,FLAG ;reads the polygon header - ;PRINT,'Np and bounds:',ID,NP,LEV,MW,ME,MS,MN - VECTOR=LONARR(NP*2) - READU,unit,VECTOR - VECTOR=TRANSPOSE(REFORM(VECTOR,2,NP)) - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - tempoPoly(IC,1)=ID - tempoPoly(IC,3)=LEV - tempoPoly(IC,4)=MW - tempoPoly(IC,5)=ME - tempoPoly(IC,6)=MS - tempoPoly(IC,7)=MN - tempoPoly(IC,8)=AREA - tempoPoly(IC,9)=FLAG - ;FOR I=0L,NP-1 DO BEGIN - ; PRINTF,unit2,FORMAT='(2F11.6,F8.2)',VECTOR(I,0)*1.E-6-360.,vectOR(I,1)*1.E-6,depthcote - ;ENDFOR - - IF (outreduced EQ 1) THEN BEGIN - kountk=0L - X=LONARR(NP) - Y=X - X(*)=VECTOR(*,0) - Y(*)=VECTOR(*,1) - Keep=WHERE(((((FLOAT(X)*1.E-6+180.) MOD 360.) $ - -rlonmax-marginx-180) LE 0.) AND $ - ((((FLOAT(X)*1.E-6+180.) MOD 360.) $ - -rlonmin+marginx-180) GE 0.) AND $ - ((FLOAT(Y)*1.E-6 $ - -rlatmax-marginy) LE 0.) AND $ - ((FLOAT(Y)*1.E-6 $ - -rlatmin+marginy) GE 0.),kountk) - NPO=NP-kountk - NP=kountk - IF kountk GT 0 THEN BEGIN - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTOR(Keep,*) - IP1=KEEP(0) - IP2=KEEP(kountk-1) - ;PRINT,'IP1, IP2:',IP1,IP2 - ;PRINT,'KEEP:',KEEP - x2=((VECTOR(IP2,0)*1.E-6+180.) MOD 360.)-180. - y2=VECTOR(IP2,1)*1.E-6 - x1=((VECTOR(IP1,0)*1.E-6+180.) MOD 360.)-180. - y1=VECTOR(IP1,1)*1.E-6 - PRINT,'IC: ',IC,ID,NP,kountk,NPO,NPO+NP,IP1,IP2,x1,x2,y1,y2,xc,yc - - IF (NPO GT 0) THEN BEGIN - IF (ABS(x2-x1) GT ABS(rlonmax-rlonmin)) $ - OR ABS(y2-y1) GT ABS(rlatmax-rlatmin) THEN BEGIN - a=(y1-y2)/(y2*x1-x2*y1) - b=(x2-x1)/(y2*x1-x2*y1) - c=1 - - IF (X2-X1)*(y2-y1) LT 0 THEN BEGIN - IF (a*xc+b*yc+c)*(a*rlonmax+b*rlatmax+c) GT 0 THEN BEGIN - ;tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmax+marginx+360.)*1.E6 - ;tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmax+marginy)*1.E6 - PRINT,'Adding point in polygon (1,1)...' - ENDIF ELSE BEGIN - ;tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmin-marginx+360.)*1.E6 - ;tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmin-marginy)*1.E6 - PRINT,'Adding point in polygon (-1,-1)...' - ENDELSE - ENDIF ELSE BEGIN - IF (a*xc+b*yc+c)*(a*rlonmax+b*rlatmin+c) GT 0 THEN BEGIN - tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmin-marginx+360.)*1.E6 - tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmax+marginy)*1.E6 - PRINT,'Adding point in polygon (-1,1)...' - ENDIF ELSE BEGIN - tempoPoint(tempoPoly(IC,0)+NP,0)=FLOAT(rlonmax+marginx+360.)*1.E6 - tempoPoint(tempoPoly(IC,0)+NP,1)=FLOAT(rlatmin-marginy)*1.E6 - PRINT,'Adding point in polygon (1,-1)...' - ENDELSE - ENDELSE - NP=NP+1 - ENDIF - ENDIF - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - IC=IC+1 - ENDIF - ENDIF ELSE BEGIN - - IF (FLOAT(MS)*1.E-6 LT -80.) THEN BEGIN - NP=NP+1 - print,'Antarctica:',vectOR(0:1,0) - tempo=vectOR - VECTOR=LONARR(NP,2) - vectOR(0,0)=FIX(rlonmax)*1000000 - vectOR(0,1)=FIX(-90)*1000000 - vectOR(NP-1,0)=FIX(rlonminn)*1000000 - vectOR(NP-1,1)=FIX(-90)*1000000 - - VECTOR(1:NP-2,0:1)=tempo(0:np-3,0:1) - ENDIF - X=FLTARR(NP) - X(*)=FLOAT(VECTOR(*,0)*1.E-6 - rlonminn) - index=WHERE(X EQ 360.,kount) - X(*)=(X MOD 360.) - IF kount GT 0 THEN X(index)=360. - Index1=WHERE(X LT 0,kount1) - IF kount1 GT 0 THEN X(Index1)=X(Index1)+360. - - ; Looks for wrap around - XP1=SHIFT(X,-1) - Indexch=WHERE(ABS(X-XP1) GT 350.,kountch) - IF ((rlonmax-rlonmin) GT 60) AND (kountch GT 1) THEN BEGIN - ;PRINT,'Flip:',IC,kountch,Indexch,X(Indexch),XP1(Indexch) - NP2=Indexch(0)+1+NP-1-Indexch(kountch-1) - FOR Iwrap=1,kountch-2,2 DO BEGIN - NP2=NP2+Indexch(Iwrap+1)-Indexch(Iwrap) - ENDFOR - NP3=NP-NP2 - VECTR=FLTARR(NP2,2) - VECTR3=FLTARR(NP3,2) - VECTR(0:Indexch(0),0)=X(0:Indexch(0))-marginx - VECTR(0:Indexch(0),1)=FLOAT(VECTOR(0:Indexch(0),1))*1.E-6-rlatmin - Ip2=Indexch(0)+1 - Iwrap=0 - Ip3=0 - FOR Iwrap=1,kountch-1,2 DO BEGIN - IF (Iwrap LT kountch-1) then BEGIN - VECTR(Ip2:Ip2+Indexch(Iwrap+1)-Indexch(Iwrap)-1,0) $ - =X(Indexch(Iwrap)+1:Indexch(Iwrap+1))-marginx - VECTR(Ip2:Ip2+Indexch(Iwrap+1)-Indexch(Iwrap)-1,1) $ - =FLOAT(VECTOR(Indexch(Iwrap)+1:Indexch(Iwrap+1),1))*1.E-6-rlatmin - Ip2=Ip2+Indexch(Iwrap+1)-Indexch(Iwrap) - ENDIF - VECTR3(Ip3:Ip3+Indexch(Iwrap)-Indexch(Iwrap-1)-1,0) $ - =X(Indexch(Iwrap-1)+1:Indexch(Iwrap))-marginx - VECTR3(Ip3:Ip3+Indexch(Iwrap)-Indexch(Iwrap-1)-1,1) $ - =FLOAT(VECTOR(Indexch(Iwrap-1)+1:Indexch(Iwrap),1))*1.E-6-rlatmin - Ip3=Ip3+Indexch(Iwrap)-Indexch(Iwrap-1) - ENDFOR - VECTR(Ip2:NP2-1,0)=X(Indexch(kountch-1)+1:NP-1)-marginx - VECTR(ip2:NP2-1,1)=FLOAT(VECTOR(Indexch(kountch-1)+1:NP-1,1))*1.E-6-rlatmin - NPold=NP - NP=NP2 - - IF (IP3 GT 3) THEN BEGIN - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTR(*,*) - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - - IC=IC+1 - NP=NP3 - VECTR=VECTR3 - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - tempoPoly(IC,1)=ID - tempoPoly(IC,3)=LEV - tempoPoly(IC,4)=MW - tempoPoly(IC,5)=ME - tempoPoly(IC,6)=MS - tempoPoly(IC,7)=MN - tempoPoly(IC,8)=AREA - tempoPoly(IC,9)=FLAG - ENDIF - - ENDIF ELSE BEGIN - VECTR=FLTARR(NP,2) - VECTR(*,0)=X(*)-6.*marginx - VECTR(*,1)=FLOAT(VECTOR(*,1))*1.E-6-rlatmin - ENDELSE - tempoPoint(tempoPoly(IC,0):tempoPoly(IC,0)+NP-1,0:1)=VECTR(*,*) - tempoPoly(IC,2)=NP - tempoPoly(IC+1,0)=tempoPoly(IC,0)+NP - IC=IC+1 - ENDELSE - ENDWHILE - ;CLOSE,unit2 - ;FREE_LUN,unit2 - - Npoly=IC - GSHHSPoly=tempoPoly(0:Npoly,*) - PRINT,'Number of relevant polygons:',IC,GSHHSPoly(Npoly),SIZE(tempoPoint) - PRINT,'Bounds of poly 1:',tempoPoly(0,4:7)*1E-6 - - - GSHHSPoint=tempoPoint(0:GSHHSPoly(Npoly)-1,*) - -;************************************************ -; Outputs a reduced version of the original file - IF (outreduced EQ 1) THEN BEGIN - GET_LUN,unit2 - OPENW,unit2,'gshhs_cal.b' - FOR I=0L,Npoly-1 DO BEGIN - WRITEU,unit2,GSHHSPoly(I,1:9) - NP=GSHHSPoly(I,2) - AR=LONARR(NP,2) - AR(*,*)=GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,*) - WRITEU,unit2,REFORM(TRANSPOSE(AR),NP*2) - ENDFOR - CLOSE,unit2 - FREE_LUN,unit2 - ENDIF -;************************************************ - ; COnverts to kilometers - tempo=GSHHSPOINT - GSHHSPoint=FLTARR(GSHHSPoly(Npoly),2) - GSHHSPoint(*,0)=(nx-1)*dx*tempo(*,0)/ABS(rlonmax-rlonmin) - GSHHSPoint(*,1)=(ny-1)*dy*tempo(*,1)/ABS(rlatmax-rlatmin) - END - - 22: BEGIN - message,'Loading table ' + filenames(filetype),/INFO - r=BYTARR(256) - g=BYTARR(256) - b=BYTARR(256) - READF,unit,r,g,b - cbot = 0 - nc = !d.table_size - cbot - if nc ne 256 then begin ;Interpolate - p = (lindgen(nc) * 255) / (nc-1) - r = r[p] - g = g[p] - b = b[p] - endif - r_orig[cbot] = r - g_orig[cbot] = g - b_orig[cbot] = b - r_curr = r_orig - g_curr = g_orig - b_curr = b_orig - tvlct,r, g, b, cbot - END - ELSE:PRINT,'File type not supported' - - ENDCASE - filestatus(filetype)=filestatus(filetype)-1 - IF filestatus(filetype) EQ 0 THEN CLOSE,unit - datastatus(filetype)=1 - PRINT,'File type ',STRCOMPRESS(filetype),' read:',paths(filetype),filenames(filetype) -RETURN -END -;----------------------------------------------------------------------------- -PRO READ_CDF,COUNTS,OFFSETS,times,varnorm,vardir,varname -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON FREQ, freq,nfband,findex,findex2 -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON WW3, ww3model,ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path,spec2D,ww3matrix2,ww3dir2,ncid,ncid2,ncivar0,ncivar -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat - ncall=NCDF_INQUIRE(ncid) - nvars=ncall.NVARS - triid=NCDF_VARID(ncid,'tri') - MAPSTAid=NCDF_VARID(ncid,'MAPSTA') - timeid=NCDF_VARID(ncid,'time') - taille=SIZE(counts) - NC=taille(1) -; - ncvar=NCDF_VARINQ(ncid,ncivar) - ndimvar=ncvar.NDIMS -; - var3=NCDF_VARINQ(ncid,ncivar) - attOK=NCDF_ATTINQ(ncid,ncivar,'scale_factor') - IF (attOK.Length GT 0) THEN NCDF_ATTGET,ncid,ncivar,'scale_factor',ww3scale $ - ELSE ww3scale=1. - NCDF_ATTGET,ncid,ncivar,'_FillValue',ww3miss - NCDF_ATTGET,ncid,ncivar,'units',ww3unit - - IF (timeid GE 0) THEN $ - NCDF_VARGET,ncid,timeid,timenow,COUNT=COUNTS(NC-1),OFFSET=OFFSETS(NC-1) $ - ELSE timenow=0. - dayi=JULDAY(1,1,1990,0,0,0.) - times=DOUBLE(timenow)+DOUBLE(dayi) - - freqid=NCDF_VARID(ncid,'f') - IF (freqid GE 0) THEN BEGIN - NCDF_VARGET,ncid,freqid,freq - TEMP=COUNTS - COUNTS=LONARR(NC+1) - COUNTS(0:NC-2)=TEMP(0:NC-2) - COUNTS(NC-1)=1 - COUNTS(NC)=TEMP(NC-1) - TEMP=OFFSETS - OFFSETS=LONARR(NC+1) - OFFSETS(0:NC-2)=TEMP(0:NC-2) - OFFSETS(NC-1)=1 - OFFSETS(NC)=TEMP(NC-1) - - IF (NC EQ 3) THEN varnorm=FLTARR(COUNTS(0),COUNTS(1)) ELSE varnorm=FLTARR(COUNTS(0)) - vardir=varnorm - lg10=ALOG(10) -; -; Reads for all frequencies and adds up -; - fac=0.5*(1.1-1./1.1) - varnorm=varnorm*0. - mat2=FLOAT(varnorm) - FOR J=findex-1,findex2-1 DO BEGIN - OFFSETS(NC-1)=J - NCDF_VARGET,ncid,ncivar,mat1,COUNT=COUNTS,OFFSET=OFFSETS - IF (J EQ findex-1) THEN Index=WHERE(mat1 EQ ww3miss,kount) - IF (kount GT 0) THEN mat1(Index)=0 - IF (J EQ findex-1) THEN Index2=WHERE(mat1 NE 0.,kount2) - CASE STRING(ww3unit) OF - 'log10(m2s+1E-12)':BEGIN - IF (kount2 GT 0) THEN $ - mat2(Index2)=exp(lg10*FLOAT(mat1(Index2))*ww3scale)-(1E-12-1E-16) - varnorm=varnorm+mat2*freq(J)*fac - END - 'log10(m4s+0.01)':BEGIN - IF (kount2 GT 0) THEN $ - mat2(Index2)=exp(lg10*FLOAT(mat1(Index2))*ww3scale)-0.00999 - varnorm=varnorm+mat2*freq(J)*fac - END - 'log10(m4s+1E-12':BEGIN - IF (kount2 GT 0) THEN $ - mat2(Index2)=exp(lg10*FLOAT(mat1(Index2))*ww3scale)-(1E-12-1E-16) - varnorm=varnorm+mat2*freq(J)*fac - END - ELSE: BEGIN - varnorm=varnorm+FLOAT(mat1*ww3scale)*freq(J)*fac - END - ENDCASE - ENDFOR - - CASE STRING(ww3unit) OF - 'log10(m4s+0.01)': ww3unit='m4' - 'log10(m2s+1E-12)': BEGIN - ww3unit='m' - varnorm=4.*sqrt(varnorm) - var3.name='Hs' - Index2=WHERE(mat1 NE ww3miss,kount2) - maxOK=MAX(varnorm(Index2)) - IF (maxOK LT 2.) THEN BEGIN - varnorm=1000*varnorm - ww3unit='mm' - var3.name='HsIG' - ENDIF - END - ELSE: - ENDCASE - varname = var3.name+' ('+STRING(ww3unit)+')' - varname = varname + ' (integrated from '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +' to '+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (kount GT 0) THEN varnorm(index)=-2.*maxval - ENDIF ELSE BEGIN -; -; non-spectral data -; - NCDF_VARGET,ncid,ncivar,varnorm,COUNT=COUNTS(0:ndimvar-1),OFFSET=OFFSETS(0:ndimvar-1) - var3=NCDF_VARINQ(ncid,ncivar) - varname = var3.name+' ('+STRING(ww3unit)+')' - Index=WHERE(varnorm EQ ww3miss,kount) - IF STRPOS(var3.name,'fp') GT -1 THEN BEGIN - ;varnorm=varnorm*ww3scale - varnorm=1./(varnorm*ww3scale ) - var3.name='Tp' - print,'conversion of fp to tp... ',var3.name,MAX(varnorm) - ENDIF ELSE varnorm=varnorm*ww3scale - vardir=varnorm*0 - IF (kount GT 0) THEN varnorm(index)=-2.*maxval -; -; Computes norm from 2 components -; - IF (normvec EQ 1) THEN BEGIN - IF (nvars GT ncivar+1 AND (triid GE 0 OR ndimvar GT 2) ) THEN BEGIN - var4=NCDF_VARINQ(ncid,ncivar+1) - firstchar=STRUPCASE(STRMID(var4.name,0,1)) - IF firstchar EQ 'V' or var4.name EQ 'mssy' THEN BEGIN - NCDF_VARGET,ncid,ncivar+1,var2,COUNT=COUNTS,OFFSET=OFFSETS - var2=var2*ww3scale -; transforms into trig direction - vardir=90.-ATAN(-var2,-varnorm)/!dtor - IF (var3.name EQ 'mssx') THEN BEGIN - bvarnorm=varnorm+var2 - varname='mss' - ENDIF ELSE BEGIN - varnorm=SQRT(varnorm^2+var2^2) - varname = 'sqrt('+var3.name+'^2'+var4.name+'^2' $ - +') ('+STRING(ww3unit)+')' - ENDELSE - IF (kount GT 0) THEN vardir(index)=2.*maxval - ENDIF - ENDIF - ENDIF - IF STRPOS(var3.name,'th') GT -1 OR var3.name EQ 'dir' $ - OR var3.name EQ 'dp ' OR ww3fieldname EQ '.pth' THEN BEGIN - vardir=varnorm - ncid2=ncid - ENDIF - ENDELSE - RETURN - END -;----------------------------------------------------------------------------- -PRO UPDATE_WW3_TIME -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON FREQ, freq,nfband,findex,findex2 -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON WW3, ww3model,ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path,spec2D,ww3matrix2,ww3dir2,ncid,ncid2,ncivar0,ncivar - - indext=tindex-1 -; -; Updates the NetCDF WW3 data and redo the plot -; - triid=NCDF_VARID(ncid,'tri') - ncvar=NCDF_VARINQ(ncid,ncivar) - ndimvar=ncvar.NDIMS - - IF (triid EQ -1) THEN BEGIN - dimxid=NCDF_DIMID(ncid,'longitude') - dimyid=NCDF_DIMID(ncid,'latitude') - IF (dimxid EQ -1) THEN BEGIN - dimxid=NCDF_DIMID(ncid,'x') - dimyid=NCDF_DIMID(ncid,'y') - END - IF (dimxid EQ -1) THEN BEGIN - dimxid=NCDF_DIMID(ncid,'lon') - dimyid=NCDF_DIMID(ncid,'lat') - END - - NCDF_DIMINQ,ncid,dimxid,name1,nx - NCDF_DIMINQ,ncid,dimyid,name1,ny - - READ_CDF,[nx,ny,1],[0,0,indext],times,varnorm,vardir,varname - ww3m=FLTARR(nx,ny) - IF ( ndimvar GT 2) THEN ww3m=varnorm(*,*,0) ELSE ww3m=varnorm - - IF (MIN(vardir) LT MAX(vardir)) THEN BEGIN - ww3dir=FLTARR(nx,ny) - ww3dir=vardir(*,*,0) - ENDIF - ENDIF ELSE BEGIN - READ_CDF,[nngp,1], [0,indext],times,varnorm,vardir,varname - ww3m=FLTARR(nngp) - ww3m(*)=varnorm(*,0) - IF (MIN(vardir) LT MAX(vardir)) THEN BEGIN - ww3dir=FLTARR(nngp) - ww3dir=vardir(*,0) - ENDIF - ENDELSE -; -PRINT,'MAX & MIN:',MAX(ww3m),MIN(ww3m) - ww3matrix=ww3m - ww3fieldname=varname - dayi=JULDAY(1,1,1990,0,0,0.) - - Time1toDate,times(0),ww3date,ww3time - RETURN - END - - - -;----------------------------------------------------------------------------- -PRO analyzer_event, ev -;+ -; NAME: analyzer_event -; PURPOSE: handles events on the main window -; (i.e. action on a widget) as they occur -; CALLING SEQUENCE: analyzer_event, ev -; where ev is a structure event variable -; INPUT: ev=widget id of the base widget -; COMMON BLOCKS: datainfo,xyz,choices,drawsize,plotvar,widgets,datatype, -; current,smallval,zoomidx,vecprm,prprm,psprm,dlprm,pmprm, -; flags,rotprm,rotarr -;- - -;** 1 ** Display parameters -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON WGene,Wgrideditor,WG,root -COMMON INTERFACE, TWISTVA_VERSION -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - -;** 2 ** Display and data variables/parameters -COMMON FREQ, freq,nfband,findex,findex2 -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -COMMON DIR, nabin,nabint,aindex,THETA -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri -common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr - -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON ARR8m, nfTom,naTom,TomF,Tomth,OBS8m,MOD8m -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON COAST, coastxy,coastl,coastnp,GSHHSPoly,GSHHSPoint,GSHHSPoly2,GSHHSPoint2 -COMMON DEPTHSTAT,nbind,bindres,HISTD,MEAND,SDEVD -COMMON DIRSPEC, ds,dsnfband,ndir,kdkdth,dsfreq,dstheta,dsdf,dstime,dsntime,ds_timezone -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON RAY3, crestsnap,freq1,freq2,datar3,datar3D,datar4D,titr1,titr2, $ - nfields2D,nfields3D,nfields,timer3,dayr3 -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON RAY3ad, NGPad,SIad,SCad,DEPTHad,HSad,PSIad,BBLDad -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON SOURCE, S0,snabin,sntstep -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON LOCAL, nxz1,nyz1,nxz2,nyz2 -COMMON WW3, ww3model,ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path,spec2D,ww3matrix2,ww3dir2,ncid,ncid2,ncivar0,ncivar -COMMON HScalc,Hsc -;*******END OF COMMON BLOCKS******************************* - - type = TAG_NAMES(ev, /STRUCTURE) ;obtain name of event structure - CASE type OF - 'WIDGET_BUTTON': BEGIN ;callback for the widget buttons - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE value OF - 'Norm': normvec = 1-normvec; - 'Quit': BEGIN ;Quit button - taille=size(filestatus) - FOR I=0,taille(1)-1 DO CLOSE,i+1 ;closes all files - WIDGET_CONTROL, /DESTROY, ev.top ;destroys main widget - RETURN - END - 'Palette': PALETTE,GROUP=ev.top ;calls the palette - ;which is a modified version - ;of the std idl tool - ;subwindow - 'PickNew': BEGIN - clickflag=0 ;this flag tells the draw window - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - END - ;that the next click will be to - ;choose the current grid point - 'Refresh' : doplot ;does a plot with current param - - ;'Mesh' : IF (subwin(3) EQ 0) THEN IF (N_ELEMENTS(dx) NE 0) THEN Generator, ev.top ;calls the grid builder - 'Mesh' : IF (N_ELEMENTS(dx) NE 0) THEN Generator, ev.top ;calls the grid builder - 'Maps' : Mapping, ev.top ;calls the map tool window - ;'Plot parameters' : IF (subwin(0) EQ 0) THEN Parametros, ev.top ;calls the parameters - 'Plot parameters' : Parametros, ev.top ;calls the parameters - 'Rays': Raytracemenu,ev.top ;calls the ray tracing -; 'Transect tool': Maketransect,ev.top;calls the transect maker - 'Special points': Editspecials,ev.top - 'Bathy': Bathytool,ev.top - 'Zoom': BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - clickflag=1 ;zoom (corners of the zoom window - END ;are given by clicking on drawing) - 'Zoom out':BEGIN ;resets the zoom to full area - clickflag=0 - print,'ZOOM COORDINATES WAS:',nxzmin,nxzmax,nyzmin,nyzmax - nxzmin=0 - nyzmin=0 - nxzmax=nx-1 - nyzmax=ny-1 - doplot - END - 'Move': BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - clickflag=2 ;zoom (corners of the zoom window - END ;are given by clicking on drawing) - 'EndMove': BEGIN - WIDGET_CONTROL,Wdraw,EVENT_PRO='analyzer_event' - clickflag=0 ;zoom (corners of the zoom window - END ;are given by clicking on drawing) - 'Export spec2D':BEGIN - GET_LUN,unitspec - OPENW,unitspec,'../REFDIF/Spec2D.dat' - taille=size(Spec2d) - FOR I=0,taille1(1)-1 DO BEGIN - - PRINTF,unitspec,Spec2d(I,*) - ENDFOR - END - ELSE: PRINT, 'Last Request Ignored' - ENDCASE - END - 'WIDGET_DRAW':BEGIN - CASE ev.id OF - Wdraw: IF MAPFLAG EQ 0 THEN BEGIN - CASE ev.type OF ;case loop on action types - 0:BEGIN ;ev.type=0 : click (button pushed down) - CASE clickflag OF - 0:IF (datatype EQ 4) THEN BEGIN - coordP=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - c_x=coordP(0) - c_y=coordP(1) - NEAREST_POINT - IF datastatus(5) THEN BEGIN ;changes the current grid point - OPLOT,[gridmat(0,c_gp-1)],[gridmat(1,c_gp-1)], $ - psym=5,SYMSIZE=0.6 - strlab=strcompress(string(c_gp),/REMOVE_ALL) - XYOUTS,gridmat(0,c_gp-1),gridmat(1,c_gp-1), $ - strlab,CHARSIZE=0.9 - WIDGET_CONTROL,Wright(11,1), SET_VALUE=STRCOMPRESS(STRING(c_gp),/REMOVE_ALL) - ENDIF ELSE BEGIN - OPLOT,[c_x],[c_y], psym=5,SYMSIZE=0.6 - ENDELSE - ENDIF - - 1:BEGIN - coordP=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - nxz1=MIN([MAX([nxzmin,ROUND((coordP(0))/dx)]),nxzmax]) - nyz1=MIN([MAX([nyzmin,ROUND((coordP(1))/dy)]),nyzmax]) - END - 2:BEGIN - coordP=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - nxz2=MIN([MAX([nxzmin,ROUND((coordP(0))/dx)]),nxzmax]) - nyz2=MIN([MAX([nyzmin,ROUND((coordP(1))/dy)]),nyzmax]) - END - ENDCASE - END - 1:BEGIN ;ev.type=1 button release - CASE clickflag OF - 1:BEGIN ;picks up the second corner of the - ;zoom window when the button is released - coordR=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - nxz2=MAX([MIN([nxzmax,ROUND((coordR(0))/dx)]),nxzmin]) - nyz2=MAX([MIN([nyzmax,ROUND((coordR(1))/dy)]),nyzmin]) - nx1=MIN([nxz1,nxz2]) - nx2=MAX([nxz1,nxz2]) - IF (nx1 EQ nx2) THEN BEGIN - IF nx2 LT nxzmax THEN nx2=nx2+1 ELSE nx1=nx1-1 - ENDIF - ny1=MIN([nyz1,nyz2]) - ny2=MAX([nyz1,nyz2]) - IF (ny1 EQ ny2) THEN BEGIN - IF ny2 LT nyzmax THEN ny2=ny2+1 ELSE ny1=ny1-1 - ENDIF - nxzmax=nx2 - nxzmin=nx1 - nyzmax=ny2 - nyzmin=ny1 - clickflag=0 ;resets the clickflag to zero - ;PRINT,'Zoom indices:',nxzmin,nxzmax,nyzmin,nyzmax - doplot - END - 2:BEGIN ;Moves zoom around when the button is released - coordR=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - nxz1=MAX([MIN([nxzmax,ROUND((coordR(0))/dx)]),nxzmin]) - nyz1=MAX([MIN([nyzmax,ROUND((coordR(1))/dy)]),nyzmin]) - IF nxz2 GT nxz1 THEN BEGIN - movex=MIN([nxz2-nxz1,nx-1-nxzmax]) - nxzmax=nxzmax+movex - nxzmin=nxzmin+movex - ENDIF ELSE BEGIN - movex=MAX([nxz2-nxz1,-nxzmin]) - nxzmax=nxzmax+movex - nxzmin=nxzmin+movex - ENDELSE - IF nyz2 GT nyz1 THEN BEGIN - movey=MIN([nyz2-nyz1,ny-1-nyzmax]) - nyzmax=nyzmax+movey - nyzmin=nyzmin+movey - ENDIF ELSE BEGIN - movey=MAX([nyz2-nyz1,-nyzmin]) - nyzmax=nyzmax+movey - nyzmin=nyzmin+movey - ENDELSE - ;PRINT,'Zoom indices:',nxzmin,nxzmax,nyzmin,nyzmax - doplot - END - ELSE: - ENDCASE - END ;when the button is released - - ; Updates the cursor position and value of the current field - 2:IF Wdraw_value_update GT 0 THEN BEGIN - IF datastatus (2) OR datastatus(20) THEN BEGIN ;ev.type=2 when the cursor is in - ;in the drawing window - coord=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - i0=max([0,ROUND(coord(0)/dx)]) - j0=max([0,ROUND(coord(1)/dy)]) - IF ((i0 LT nx) AND (j0 LT ny)) THEN BEGIN - valeur=0. - CASE 1 OF - datastatus(3) EQ 1:BEGIN - valeur=gd(i0,j0) - WIDGET_CONTROL,Wright(14,5), $ - SET_VALUE=STRING(valeur,FORMAT='(F7.2)') - END - datastatus(20) EQ 1:BEGIN - taille=size(ww3matrix) - IF (taille(0) GT 1) THEN BEGIN - valeur=ww3matrix(i0,j0) - WIDGET_CONTROL,Wright(14,3), $ - SET_VALUE=STRING(valeur,FORMAT='(F7.2)') - ENDIF - END - ELSE: - ENDCASE - - - ENDIF - WIDGET_CONTROL,Wright(14,1), $ - SET_VALUE=(STRING(coord(0),FORMAT='(F8.2)')+','+STRING(coord(1),FORMAT='(F8.2)')) - ;XYstring='X:'+STRING(coord(0),FORMAT='(F8.3)') $ - ; +', Y:'+STRING(coord(1),FORMAT='(F.3)') - XYtoLatLon,coord(0),coord(1), $ - latdeg,latmin,londeg,lonmin,latlonstring,latlonstring2 - IF (MAPLONLAT GE 1) THEN WIDGET_CONTROL,Wright(15,1), $ - SET_VALUE=(latlonstring+'/'+latlonstring2) ELSE $ - WIDGET_CONTROL,Wright(15,1),SET_VALUE='' - ENDIF - ENDIF - ELSE:BEGIN ; Wheel action - IF (N_ELEMENTS(dx) NE 0 ) THEN BEGIN - coordR=CONVERT_COORD(ev.X,ev.Y, /DEVICE,/TO_DATA) - nxz1=MAX([MIN([nxzmax,ROUND((coordR(0))/dx)]),nxzmin]) - nyz1=MAX([MIN([nyzmax,ROUND((coordR(1))/dy)]),nyzmin]) - width=FLOAT(nxzmax-nxzmin)/2. - height=FLOAT(nyzmax-nyzmin)/2. - IF (ev.CLICKS EQ 1) THEN BEGIN - width=width/1.5 - height=height/1.5 - ENDIF ELSE BEGIN - width=width*1.5 - height=height*1.5 - ENDELSE - nxzmax=MIN([nx-1,nxz1+ROUND(width)]) - nxzmin=MAX([0 ,nxz1-ROUND(width)]) - nyzmax=MIN([ny-1,nyz1+ROUND(height)]) - nyzmin=MAX([0 ,nyz1-ROUND(height)]) - doplot - ENDIF - END - ENDCASE ; ev.type - END - ENDCASE ; end of case test on ev.id - END - 'WIDGET_DROPLIST':BEGIN - WIDGET_CONTROL, Wdraw, SENSITIVE=0 - CASE ev.id of - Wright(0,0):BEGIN - CASE ev.index of - ;0:BEGIN - ; datatype=0 - ; WIDGET_CONTROL,Wright(1,2),SET_VALUE=['2D','Trans','Local'] - ; END - 0:IF N_ELEMENTS(modspec) NE 0 THEN BEGIN - WIDGET_CONTROL,Wright(1,1),SET_VALUE=STRCOMPRESS(*modspec.varnames) - WIDGET_CONTROL,Wright(11,3),SET_VALUE=STRCOMPRESS(*modspec.pnames) - - IF (modspec.nabin GT 1) THEN WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['TS Bulk','Time series','f-spectrum', $ - 'Averaged f-spectrum','f-time plot','f-theta spec'] $ - ELSE IF (modspec.nfband GT 1) THEN WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['TS Bulk','Time series','f-spectrum','time-average', $ - 'freq-time','Diff vs fp','????', $ - 'Diff vs val','Binned plot','var U10,Hs'] $ - ELSE WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['Time series'] - - IF modspec.nfband GT 1 THEN WIDGET_CONTROL,Wright(1,3), $ - SET_VALUE=['bulk=Hs','bulk=mss','bulk=Uss','bulk=Ussd','bulk=varu','bulk=alpha','bulk=T01','bulk=T02'] - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=modspec.nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=modspec.nfband - findex2=min([modspec.nfband,findex2]) - findex=min([modspec.nfband,findex]) - IF (findex2 LE findex) THEN findex=findex2-1 - IF (findex LT 1) THEN findex=1 - - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=modspec.ntime - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=modspec.ntime - IF tindex2 GT modspec.ntime THEN tindex2=modspec.ntime - IF tindex GT modspec.ntime THEN tindex=modspec.ntime - IF findex2 GT modspec.nfband THEN findex2=modspec.nfband - IF findex GT modspec.nfband THEN findex=modspec.nfband - IF (findex2 LE findex) THEN findex=findex2-1 - IF (findex LT 1) THEN findex=1 - - freq=(*modspec.f) - nfband=N_ELEMENTS(freq) - time=(*modspec.dates) - datatype=2 - ENDIF - 1:IF N_ELEMENTS(obs) NE 0 THEN BEGIN - WIDGET_CONTROL,Wright(1,1),SET_VALUE=STRCOMPRESS(*obs.varnames) - WIDGET_CONTROL,Wright(0,2),SET_VALUE=STRCOMPRESS(*obs.pnames) - WIDGET_CONTROL,Wright(11,3),SET_VALUE=STRCOMPRESS(*obs.pnames) - IF (obs.nabin GT 1) THEN WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['TS Bulk','Time series','f-spectrum', $ - 'Averaged f-spectrum','f-time plot','f-theta spec'] $ - ELSE IF (obs.nfband GT 1) THEN WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['TS Bulk','Time series','f-spectrum','Averaged f-spectrum', $ - 'scatter plot','Diff vs fp','Q-Q plot', $ - 'Diff vs val','Binned plot','var U10,Hs'] $ - ELSE WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['Time series'] - - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=obs.nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=obs.nfband - findex2=min([obs.nfband,findex2]) - findex=min([obs.nfband,findex]) - nfband=obs.nfband - IF obs.nfband GT 1 THEN WIDGET_CONTROL,Wright(1,3), $ - SET_VALUE=['bulk=Hs','bulk=mss','bulk=Ussnd','bulk=Uss','bulk=alpha','bulk=varu','bulk=T01','bulk=T02'] - - freq=(*obs.f) - nfband=N_ELEMENTS(freq) - time=(*obs.dates) - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=obs.ntime - WIDGET_CONTROL,Wright(12,4),SET_SLIDER_MAX=obs.ntime - IF tindex2 GT obs.ntime THEN tindex2=obs.ntime - IF tindex GT obs.ntime THEN tindex=obs.ntime - IF findex2 GT obs.nfband THEN findex2=obs.nfband - IF findex GT obs.nfband THEN findex=obs.nfband - datatype=1 - - ENDIF - 2: IF ((N_ELEMENTS(modspec) NE 0) AND (N_ELEMENTS(obs) NE 0)) THEN BEGIN - ;for comparisons: determines common variables, frequencies ... - ;The following structures contains arrays of indices for the arrays of - ;observations and model output BUT NOT THE DATA ITSELF ! - om={commons, typ:0, nfband:0, nabin:0, np:0, nvar:0, ntime:0L, $ - fo:ptr_new(), po:ptr_new(), vo:ptr_new(), dateo: ptr_new(), $ - fm:ptr_new(), pm:ptr_new(), vm:ptr_new(), datem: ptr_new()} - nfmax=MAX([modspec.nfband,obs.nfband]) - npmax=MAX([modspec.np,obs.np]) - nvmax=MAX([modspec.nvar,obs.nvar]) - ntimemax=MAX([modspec.ntime,obs.ntime]) - fo=INTARR(nfmax) - fm=INTARR(nfmax) - po=INTARR(npmax) - pm=INTARR(npmax) - vo=INTARR(nvmax) - vm=INTARR(nvmax) - dateo=LONARR(ntimemax) - datem=LONARR(ntimemax) -; -; Finds common variables -; - nvarc=0 - FOR I=0,obs.nvar-1 DO BEGIN - FOR J=0,modspec.nvar-1 DO BEGIN - IF (strcompress((*obs.varnames)[I],/REMOVE_ALL) EQ $ - strcompress((*modspec.varnames)[J],/REMOVE_ALL)) THEN BEGIN - vo(nvarc)=I - vm(nvarc)=J - nvarc=nvarc+1 - ENDIF - ENDFOR - ENDFOR -; -; Finds common points -; - IF (obs.np EQ 1 AND modspec.np EQ 1 ) THEN BEGIN - npc=1 - po(0)=0 - pm(0)=0 - ENDIF ELSE BEGIN - npc=0 - FOR I=0,obs.np-1 DO BEGIN - FOR J=0,modspec.np-1 DO BEGIN - IF (strcompress((*obs.pnames)[I],/REMOVE_ALL) $ - EQ strcompress((*modspec.pnames)[J],/REMOVE_ALL)) THEN BEGIN - po(npc)=I - pm(npc)=J - npc=npc+1 - ENDIF - ENDFOR - ENDFOR - ENDELSE -; -; Finds common frequencies -; - nfc=0 - IF (obs.typ GT 0) THEN BEGIN - FOR I=0,obs.nfband-1 DO BEGIN - FOR J=0,modspec.nfband-1 DO BEGIN - IF (ABS((*obs.f)[I]-(*modspec.f)[J]) $ - LT 0.2*((*obs.df)[I]+(*modspec.df)[J]) AND I LT obs.nfband) THEN BEGIN - ;print,'commons :',I,J,(*obs.f)[I],(*modspec.f)[J],(*obs.df)[I],(*modspec.df)[J] - fo(nfc)=I - fm(nfc)=J - IF (nfc LT nfmax-1) THEN nfc=nfc+1 - ENDIF - ENDFOR - ENDFOR - ENDIF ELSE BEGIN - nfc=1 - fo(0)=0 - fm(0)=0 - ENDELSE - ntimec=0L - I=0L - J=0L - dtm=abs((*modspec.dates)[2].jday-(*modspec.dates)[1].jday) - WHILE (J LT modspec.ntime) DO BEGIN - ; -; Finds common times -; - found=0 - WHILE (found EQ 0) AND (I LT obs.ntime) AND (J LT modspec.ntime) DO BEGIN - t1=((*obs.dates)[I].jday-(*obs.dates)[I].zone/24.0d) - t2=((*modspec.dates)[J].jday-(*modspec.dates)[J].zone/24.0d) - IF (ABS(t1 -t2) LT 0.3*dtm) THEN BEGIN - dateo(ntimec)=I - datem(ntimec)=J - ntimec=ntimec+1 - I=I+1 - J=J+1 - found=1 - ENDIF ELSE BEGIN - IF ((t1 GT t2) OR (I EQ obs.ntime)) THEN BEGIN - J=J+1 - ENDIF ELSE BEGIN - I=I+1 - ENDELSE - IF (J EQ modspec.ntime) THEN I=I+1 - ENDELSE - ENDWHILE - IF (I EQ obs.ntime) THEN J=J+1 - ENDWHILE - om.nvar=nvarc - om.nfband=nfc - om.np=npc - om.ntime=ntimec - print,'commons :',npc,nvarc,nfc,ntimec - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=nfc - findex2=max(nfc,findex2) - IF (nvarc*nfc*npc*ntimec NE 0) THEN BEGIN - om.vm=PTR_NEW(vm(0:nvarc-1)) - om.vo=PTR_NEW(vo(0:nvarc-1)) - om.fm=PTR_NEW(fm(0:nfc-1)) - om.fo=PTR_NEW(fo(0:nfc-1)) - om.pm=PTR_NEW(pm(0:npc-1)) - om.po=PTR_NEW(po(0:npc-1)) - om.datem=PTR_NEW(datem(0:ntimec-1)) - om.dateo=PTR_NEW(dateo(0:ntimec-1)) - WIDGET_CONTROL,Wright(1,1),SET_VALUE=STRCOMPRESS((*obs.varnames)[*om.vo]) - WIDGET_CONTROL,Wright(11,3),SET_VALUE=STRCOMPRESS((*obs.pnames)[*om.po]) - - IF (obs.nabin GT 1) THEN WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['TS Bulk','Time series','f-spectrum', $ - 'Averaged f-spectrum','f-time plot','f-theta spec'] $ - ELSE IF (nfc GT 1) THEN WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['TS Bulk','Time series','f-spectrum','Averaged f-spectrum', $ - 'scatter plot','Diff vs fp','Q-Q plot', $ - 'Diff vs val','Binned plot','var U10,Hs'] $ - ELSE WIDGET_CONTROL,Wright(1,2),SET_VALUE= $ - ['Time series',' ',' ',' ','scatter plot','Q-Q plot','binned plot','var U10,Hs'] - ; Adjusts the time sliders range to avoid errors - WIDGET_CONTROL,Wright(12,2),SET_SLIDER_MAX=om.ntime - WIDGET_CONTROL,Wright(12,4), $ - SET_SLIDER_MAX=om.ntime,SET_VALUE=om.ntime - freq=(*modspec.f)[(*om.fm)] - time=(*modspec.dates)[(*om.datem)] - nfband=om.nfband - WIDGET_CONTROL,Wright(12,0),SET_SLIDER_MAX=om.nfband - WIDGET_CONTROL,Wright(12,5),SET_SLIDER_MAX=om.nfband - IF om.nfband GT 1 THEN WIDGET_CONTROL,Wright(1,3), $ - SET_VALUE=['bulk=Hs','bulk=mss','bulk=Uss','bulk=Ussd','bulk=varu','bulk=alpha','bulk=T01','bulk=T02'] - WIDGET_CONTROL,Wright(12,5), $ - SET_SLIDER_MAX=om.nfband,SET_VALUE=om.nfband - IF findex > nfband THEN findex=1 - IF findex2 > nfband THEN findex2=nfband - - IF tindex2 GT ntimec THEN tindex2=ntimec - print,'tindex2:',tindex2,ntimeC - ENDIF ELSE BEGIN - print,'No data in common' - om.dateo=PTR_NEW(!NULL) - ENDELSE - datatype=3 - ENDIF - ENDCASE - END - - - Wright(5,1): BEGIN - filltype=ev.index - doplot - END - Wtoprow(1) : BEGIN ;file droplist - IF (ev.index GT 0) THEN BEGIN - file=DIALOG_PICKFILE(/READ, $ - PATH = PATHS(ev.index),FILTER = FILTERS(ev.index)) - IF filestatus(ev.index) THEN CLOSE,ev.index+1 - IF file NE '' THEN BEGIN - IF !VERSION.OS_FAMILY EQ 'Windows' THEN $ - spos=STRPOS(file,'\',/REVERSE_SEARCH) $ - ELSE spos=STRPOS(file,'/',/REVERSE_SEARCH) - PATHS(ev.index)=STRMID(file,0,spos+1) - filenopath=STRMID(file,spos+1,STRLEN(file)-spos-1) - filenames(ev.index)=filenopath - ReadDataFile,filenopath,ev.index,1 - ENDIF - ENDIF - END - Wright(2,1):BEGIN - datatype=4 - plotncvar=ev.index - doplot - END - Wright(1,1):BEGIN - ;plottypeold=plottype - plottype=ev.index - IF (datatype EQ 4 ) THEN BEGIN - ncivar=ncivar0+ev.index - UPDATE_WW3_TIME - ENDIF - ;plottype=plottypeold - doplot - END - Wright(1,3):BEGIN - bulktype=ev.index - doplot - END - Wright(1,2):c_cut=ev.index - Wright(3,0):addir=ev.index - Wright(3,1):adsyms=ev.index - Wright(3,2):adbathy=ev.index - Wright(4,0):adcoast=1-ev.index - Wright(4,1):adtr=1-ev.index - Wright(4,2):adtri=ev.index - Wright(4,3):adcontour=ev.index - Wright(6,1):IF ev.index GT 0 THEN BEGIN - filtersps=['*.ps','*.ps','*.ps','*.eps','*.png','*.jpg', $ - '*.tif','*.gif','*.mpg'] - print,size(filtersps) - msgs=['Sending to file ','Sending job to las1r2 ', $ - 'Sending job to col1r1 ','Saving as EPS file to ', $ - 'Saving as png file to ','Saving as JPEG file to ', $ - 'Saving as TIFF file to ','Saving as GIF file to ', $ - 'Saving as MPEG file to '] - CASE ev.index OF - 2:filep='bw.ps' - 3:filep='color.ps' - ELSE:filep=DIALOG_PICKFILE(/WRITE,PATH=pspath,FILTER=filtersps(ev.index-1)) - ENDCASE - IF filep NE '' THEN BEGIN - IF !VERSION.OS_FAMILY EQ 'Windows' THEN $ - spos=RSTRPOS(filep,'\') $ - ;spos=STRPOS(filep,'\',/REVERSE_SEARCH) $ - ELSE spos=RSTRPOS(filep,'/') - ;ELSE spos=STRPOS(filep,'/',/REVERSE_SEARCH) - pspath=STRMID(filep,0,spos+1) - print,msgs(ev.index-1),filep - - IF (ev.index LE 4) THEN BEGIN - IF ev.index EQ 4 THEN pstype=1 ELSE pstype=0 - mydevice= !D.NAME - set_plot,'ps' - DEVICE,LANGUAGE_LEVEL=2 - output=1 - !p.thick=1.0 - print,'mydevice:',mydevice - doplot - DEVICE,/CLOSE_FILE - set_plot, mydevice - IF ev.index EQ 2 THEN SPAWN,'lp -dlas1r2 bw.ps' - IF ev.index EQ 3 THEN SPAWN,'lp -dcol1r1 color.ps' - print, 'Done' - output=0 - ENDIF ELSE BEGIN - CASE ev.index OF - 5: BEGIN - image=TVRD(TRUE=1) - taille=size(image) - ymax=MIN([taille(3)-1,taille(3)*winy/mwiny+20]) - WRITE_PNG,FILEP,image(*,0:taille(2)*winx/mwinx-1,0:ymax),r_curr,g_curr,b_curr - END - 6: BEGIN - image=TVRD(TRUE=1) - taille=size(image) - WRITE_JPEG,FILEP,image,TRUE=1,QUALITY=100 - END - 7: BEGIN - image=TVRD(TRUE=1) - taille=size(image) - WRITE_TIFF,FILEP,image,COMPRESSION=0,/SHORT - END - 8: BEGIN - image=TVRD() - taille=size(image) - print,'Writing GIF file of size:',taille - WRITE_GIF,FILEP,image,r_curr,g_curr,b_curr ;,/MULTIPLE - ;WRITE_GIF,FILEP,/CLOSE - END - 9: BEGIN - image=TVRD(TRUE=1) - taille=size(image) - mpegID = MPEG_OPEN([taille(1),taille(2)]) - FOR it=tindex,ntime DO BEGIN - indext=it-1 - UPDATE_WW3_TIME - doplot - image=TVRD(TRUE=1) - taille=size(image) - iframe=tindex-it - MPEG_PUT, mpegID, IMAGE=image, FRAME=iframe - ENDFOR - MPEG_SAVE, mpegID, FILENAME=FILEP - MPEG_CLOSE, mpegID - indext=tindex-1 - END - ENDCASE - ENDELSE - ENDIF - ENDIF ELSE BEGIN - ANNOTATE - ENDELSE -; -; Extract time series from NetCDF file -; - Wright(6,2):IF datastatus(17) THEN BEGIN - NEAREST_POINT - IF (ev.index) LT 4 THEN BEGIN - ts_filetype=1 - typ=0 - modspec={specdata, typ:0, nfband:0, nabin:0, np:0, nvar:0, ntime:0L, $ - nrun:1, f1:ptr_new(), f2:ptr_new(), f:ptr_new(), df:ptr_new(), $ - theta:ptr_new(),dtheta:1.0, $ - plat:ptr_new(), plon:ptr_new(), pdepth:ptr_new(), $ - pU10:ptr_new(), pUdir:ptr_new(), $ - pCurr:ptr_new(), pCurrdir:ptr_new(), $ - pnames:ptr_new(), varnames:ptr_new(), dates: ptr_new(), $ - data:ptr_new(), flags:ptr_new(), path:ptr_new(), filename:ptr_new()} - d={date, y:0, m:0, d:0, h:0, minu:0, s:0.0, zone:0.0, jday:0.0D} - - - modspec.typ=typ - modspec.nfband=1 - modspec.nabin=1 - modspec.np=1 - modspec.nvar=1 - modspec.nrun=1 - dimtid=NCDF_DIMID(ncid,'time') - NFILES=1 - triid=NCDF_VARID(ncid,'tri') - IF (triid EQ -1) THEN BEGIN - c_i=ROUND(c_x/dx) - c_j=ROUND(c_y/dy) - XYtoLatLon,c_x,c_y,latdeg,latmin,londeg,lonmin,latlonstring,latlonstring2 - ENDIF ELSE XYtoLatLon,gridmat(0,c_gp),gridmat(1,c_gp),latdeg,latmin, $ - londeg,lonmin, latlonstring,latlonstring2 - - varn=STRARR(modspec.nvar) - varn='data from NC' - modspec.varnames=ptr_new(varn) - - varp=STRARR(modspec.np) - varp='Point' - modspec.pnames=ptr_new(varp) - temp=fltarr(1) - modspec.f=ptr_new(temp) - modspec.theta=ptr_new(temp) - modspec.df=ptr_new(temp) - - IF (ev.index) EQ 2 OR (ev.index) EQ 3 THEN BEGIN - myfile=filenames(17) - lasti = STRPOS(myfile, '_', /REVERSE_SEARCH) - PATTERN='*'+STRMID(myfile,lasti+1) - FILESOK=FILE_SEARCH(paths(17), PATTERN) - NN=SIZE(FILESOK) - NFILES=NN(1) - NCDF_CLOSE,ncid - ncid=NCDF_OPEN(FILESOK(0),/NOWRITE) - ENDIF - - ntt=0 - FOR IFILE=0,NFILES-1 DO BEGIN - NCDF_DIMINQ,ncid,dimtid,timename,nt - IF (triid EQ -1) THEN BEGIN - READ_CDF,[1,1,nt],[c_i,c_j,0],times1,varnorm,vardir,varname - ENDIF ELSE BEGIN - READ_CDF,[1,nt],[C_gp-1,0],times1,varnorm,vardir,varname - ENDELSE - ntt=ntt+nt - data=FLTARR(1,modspec.np,modspec.nvar,modspec.nfband,modspec.nabin,ntt) - times=DBLARR(ntt) - IF (ntt GT nt) THEN BEGIN - data(0,0,0,0,0,0:ntt-nt-1)=dataold - times(0:ntt-nt-1)=timesold - ENDIF - data(0,0,0,0,0,ntt-nt:ntt-1)=varnorm - times(ntt-nt:ntt-1)=times1 - dataold=data - timesold=times - IF (NFILES GT 1) THEN BEGIN - NCDF_CLOSE,ncid - IF (IFILE LT NFILES-1) THEN NEWFILE = FILESOK(IFILE+1) ELSE $ - NEWFILE = paths(17)+filenames(17) - ncid=NCDF_OPEN(NEWFILE,/NOWRITE) - message,'Reading ' + NEWFILE,/INFO - ENDIF - ENDFOR - - - modspec.ntime=ntt - - temp=INTARR(ntt)+1 - modspec.flags=ptr_new(temp) - - modspec.data=ptr_new(data) - d={date, y:0, m:0, d:0, h:0, minu:0, s:0.0, zone:0.0, jday:0.0D} - dar=REPLICATE({date},ntt) - - FOR I=0,ntt-1 DO BEGIN - CALDAT,times(i),m,d,y,h,minu,sec - dar[i].y=y - dar[i].d=d - dar[i].m=m - dar[i].h=h - dar[i].minu=minu - dar[i].s=sec - dar[i].zone=0. ;zone - dar[i].jday=times(i) - ENDFOR - modspec.dates=ptr_new(dar(0:I-1)) - datastatus(10)=1 - c_cut=0 - ENDIF -; -; Writes time series to file -; - IF (ev.index) EQ 2 OR (ev.index) EQ 3 THEN BEGIN - GET_LUN,unit - OPENW,unit,'series_from_NC.txt' - PRINTF,unit,'Time series for point:',latlonstring,' // ',latlonstring2 - FOR I=0,ntt-1 DO BEGIN - PRINTF,unit,dar[i].y,dar[i].m,dar[i].d,dar[i].h,dar[i].minu, $ - dar[i].s,data(0,0,0,0,0,i), $ - FORMAT='(I4,X,I2,X,I2,X,I2,X,I2,X,F3.1,X,F13.4)' - ENDFOR - CLOSE,unit - free_lun,unit - ENDIF -; - IF (ev.index) EQ 4 THEN BEGIN - triid=NCDF_VARID(ncid,'tri') -; -; Gets date strings for first time step -; - timeid=NCDF_VARID(ncid,'time') - NCDF_VARGET,ncid,timeid,timenow,COUNT=1,OFFSET=0 - GET_LUN,unit - OPENW,unit,'map_from_NC.txt' - PRINTF,unit,'longitude, latitude, ',ww3fieldname,' at time (MM/DD/YYYY) ',ww3date,' ',ww3time - PRINTF,unit,'missing values: ',-2.*maxval -; -; Case of structured grids -; - IF (triid EQ -1) THEN BEGIN - PRINTF,unit,'Number of points: ',NX*NY - FOR I=0,NX-1 DO BEGIN - FOR J=0,NY-1 DO BEGIN - PRINTF,unit,ww3lon(I),ww3lat(J),ww3matrix(I,J),FORMAT='(F11.6,X,f11.6,X,G12.6)' - ENDFOR - ENDFOR - ENDIF ELSE BEGIN - NCDF_VARGET,ncid,triid,ww3tri - PRINTF,unit,'Number of points: ',NNGP - FOR I=0,NNGP-1 DO BEGIN - PRINTF,unit,ww3lon(I),ww3lat(I),ww3matrix(I,0),FORMAT='(F10.6,X,f10.6,X,G12.6)' - ENDFOR - ENDELSE - CLOSE,unit - free_lun,unit - ENDIF - - ENDIF - - - - - Wright(11,3): c_spec=ev.index - ENDCASE - WIDGET_CONTROL, Wdraw, SENSITIVE=1 - END - 'WIDGET_TEXT_CH': BEGIN - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - Wright(9,1): mindepth=FLOAT(value(0)) - Wright(9,3): maxdepth=FLOAT(value(0)) - Wright(11,1): IF (FLOAT(value(0)) EQ FIX(value(0))) THEN BEGIN - c_gp=FIX(value(0)) - ENDIF ELSE BEGIN - real1=0. - real2=0. - READS,value(0),c_lon,c_lat - IF N_ELEMENTS(C_X) GT 0 THEN print,'TEST1:',c_x,c_y - C_x = !values.F_NaN - NEAREST_POINT - print,'TEST2:',c_x,c_y - ENDELSE - ENDCASE - END - 'WIDGET_SLIDER': BEGIN - - WIDGET_CONTROL, ev.id, GET_VALUE=value - CASE (ev.id) OF - Wright(12,0): BEGIN - findex=FIX(value) - IF (findex2 LE findex) THEN findex=findex2-1 - IF (findex LT 1) THEN findex=1 - WIDGET_CONTROL,Wright(12,0), SET_VALUE=findex - - IF (datatype EQ 4 AND plottype EQ 2) THEN BEGIN - UPDATE_WW3_TIME - ENDIF - END - Wright(12,5): BEGIN - findex2=FIX(value) -print,'TEST1:',findex,findex2,nfband - IF (findex2 LT findex) THEN findex2=findex+1 - IF (findex GE nfband) THEN findex=nfband-1 - WIDGET_CONTROL,Wright(12,5), SET_VALUE=findex2 - IF (datatype EQ 4 AND plottype EQ 2) THEN BEGIN - UPDATE_WW3_TIME - ENDIF -print,'TEST2:',findex,findex2 - END - Wright(12,1): BEGIN - aindex=FIX(value) - END - - Wright(12,2): BEGIN - tindex=LONG(value) - IF (tindex LT 1) THEN tindex=1 - IF (tindex2 LT tindex) THEN tindex=tindex2 - WIDGET_CONTROL,Wright(12,2), SET_VALUE=tindex - - indext=tindex-1 - IF (datatype EQ 4 ) THEN BEGIN - UPDATE_WW3_TIME - ENDIF ELSE BEGIN - - - - IF N_elements(Hsc) NE 0 THEN BEGIN - gd(*,*)=Hsc(indext,*,*) - ENDIF - IF datatype LT 4 THEN BEGIN - zs=' UTC' - assos=STRING(time[indext].m,FORMAT='(I2)')+'/'+ $ - STRING(time[indext].d,FORMAT='(I2)')+'/'+ $ - STRING(time[indext].y,FORMAT='(I4)')+' '+ $ - STRING(time[indext].h,FORMAT='(I2)')+':'+ $ - STRING(time[indext].minu,FORMAT='(I2)')+' UTC' - z=time[indext].zone - IF (z EQ -5) THEN zs=' EST' ELSE $ - IF (z NE 0) THEN BEGIN - IF (z < 0) THEN zs=zs+'-'+STRING(ABS(z),FORMAT='(f3.1)') $ - ELSE zs=zs+'+'+STRING(ABS(z),FORMAT='(f3.1)') - ENDIF - ; WIDGET_CONTROL,Wright(13,2),SET_VALUE=assos+zs - ENDIF - ENDELSE - END - Wright(12,4): BEGIN - tindex2=LONG(value) - IF (tindex2 LT tindex) THEN tindex2=tindex - WIDGET_CONTROL,Wright(12,4), SET_VALUE=tindex2 - END - ENDCASE - doplot - ;IF (ev.id NE Wright(12,2)) THEN doplot - END - ENDCASE - RETURN -END - -;---------------------------------------------------------------------------- -PRO Time1toDate,dayi,date,hour -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON LANGUAGE, ilang,dictionnaire - ;converts a time in juldays - ;to date and hour strings using julian day functions of IDL - CALDAT,dayi,month,day,year,h,min,sec - date='01/01/1994' - IF ilang GT 0 THEN BEGIN - date='01/01/1994' - STRPUT,date,STRING([48b+BYTE(month/10),48b+BYTE(month MOD 10)]),3 - STRPUT,date,STRING([48b+BYTE(day/10),48b+BYTE(day MOD 10)]),0 - ENDIF ELSE BEGIN - date='01/01/1994' - STRPUT,date,STRING([48b+BYTE(month/10),48b+BYTE(month MOD 10)]),0 - STRPUT,date,STRING([48b+BYTE(day/10),48b+BYTE(day MOD 10)]),3 - ENDELSE - STRPUT,date,STRING([48b+BYTE((year MOD 10000)/1000),48b+BYTE((year MOD 1000)/100), $ - 48b+BYTE((year MOD 100)/10),48b+BYTE(year MOD 10)]),6 - hour='00:00 '+timezone_string - STRPUT,hour,STRING([48b+BYTE(h/10),48b+BYTE(h MOD 10)]),0 - STRPUT,hour,STRING([48b+BYTE(min/10),48b+BYTE(min MOD 10)]),3 -END -;---------------------------------------------------------------------------- -PRO TimetoDate,dayi,timei,date,hour -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON LANGUAGE, ilang,dictionnaire - ;converts a time in minutes (counted from julian day dayi at 0:00) - time2=timei+30.d*365.d*60.d*24.d - ;to date and hour strings using julian day functions of IDL - CALDAT,dayi+FIX(timei/(60*24)),month,day,year - h=((time2 MOD (60*24))/ 60.d) - h=(h MOD 24) - min=(time2 MOD 60) - date='01/01/1994' - IF ilang GT 0 THEN BEGIN - date='01/01/1994' - STRPUT,date,STRING([48b+BYTE(month/10),48b+BYTE(month MOD 10)]),3 - STRPUT,date,STRING([48b+BYTE(day/10),48b+BYTE(day MOD 10)]),0 - ENDIF ELSE BEGIN - date='01/01/1994' - STRPUT,date,STRING([48b+BYTE(month/10),48b+BYTE(month MOD 10)]),0 - STRPUT,date,STRING([48b+BYTE(day/10),48b+BYTE(day MOD 10)]),3 - ENDELSE - STRPUT,date,STRING([48b+BYTE((year MOD 10000)/1000),48b+BYTE((year MOD 1000)/100), $ - 48b+BYTE((year MOD 100)/10),48b+BYTE(year MOD 10)]),6 - hour='00:00 '+timezone_string - STRPUT,hour,STRING([48b+BYTE(h/10),48b+BYTE(h MOD 10)]),0 - STRPUT,hour,STRING([48b+BYTE(min/10),48b+BYTE(min MOD 10)]),3 -END - -;---------------------------------------------------------------------------- -PRO LatLondegtomin,latdegi,londegi,latdeg,latmin,londeg,lonmin,latlonstring -;+ -; NAME: LatLondegtomin -; PURPOSE: converts X,Y coordinates into latitude and longitude -; (negative for west and south) -; with decimal minutes and a latlon string, -; e.g.: 36d40.500'N 74d22.100'W -; -; CALLING SEQUENCE: XYtoLatLon,x,y -; INPUT: x and y in kilometers -; OUTPUT: latdeg and londeg in degrees, latmin and lonmin in minutes -; if west or south, both minutes and degrees are negative -; COMMON BLOCKS: bathy -;- -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON LANGUAGE, ilang,dictionnaire - - IF londegi GT 180. THEN londegi=londegi-360. - londeg=FLOOR(londegi) - IF londeg LT 0 THEN londeg=londeg+1 - lonmin=(londegi-londeg)*60. - latdeg=FLOOR(latdegi) - IF latdeg LT 0 THEN latdeg=latdeg+1 - latmin=(latdegi-latdeg)*60. ;***check for negative values - ;latlonstring='36d40.500`N 74d22.100`'+dictionnaire.Wdir(ilang) - latlonstring='36d40.500`N 74d22.100`W' - STRPUT,latlonstring,string(ABS(latdeg),format='(I2)'),0 - STRPUT,latlonstring,string(ABS(latmin),format='(f6.3)'),3 - STRPUT,latlonstring,string(ABS(londeg),format='(I3)'),12 - STRPUT,latlonstring,string(ABS(lonmin),format='(f6.3)'),16 - IF (FLOAT(latdeg)+latmin) LT 0. THEN STRPUT,latlonstring,'S',10 - IF (FLOAT(londeg)+lonmin) GE 0. THEN STRPUT,latlonstring,'E',23 -END - -;---------------------------------------------------------------------------- -PRO XYtoLatLon,x,y,latdeg,latmin,londeg,lonmin,latlonstring,latlonstring2 -;+ -; NAME: XYtoLatLon -; PURPOSE: converts X,Y coordinates into latitude and longitude -; (negative for west and south) -; with decimal minutes and a latlon string, -; e.g.: 36d40.500'N 74d22.100'W -; -; CALLING SEQUENCE: XYtoLatLon,x,y -; INPUT: x and y in kilometers -; OUTPUT: latdeg and londeg in degrees, latmin and lonmin in minutes -; if west or south, both minutes and degrees are negative -; COMMON BLOCKS: bathy -;- -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -COMMON MAPPOLE, XPOLE, YPOLE, SLAT, RE, E2, E - - IF (MAPLONLAT LE 1) THEN BEGIN - dlon=rlonmax-rlonmin - dlat=rlatmax-rlatmin - lonmin=rlonmin+x*dlon/(dx*(nx-1)) - latmin=rlatmin+y*dlat/(dy*(ny-1)) - ENDIF ELSE BEGIN - MAPXY,X,Y,latmin,lonmin,1 - ENDELSE - lonmin=(lonmin-360*ROUND(FLOAT(lonmin)/360)) ;gives a longitude between -180 and 180 - londec=lonmin - londeg=FLOOR(lonmin) - IF londeg LT 0 THEN londeg=londeg+1 - lonmin=(lonmin-londeg)*60. - latdec=latmin - latdeg=FLOOR(latmin) - IF latdeg LT 0 THEN latdeg=latdeg+1 - latmin=(latmin-latdeg)*60. ;***check for negative values - latlonstring='36d40.500`N 74d22.100`W' - STRPUT,latlonstring,string(ABS(latdeg),format='(I2)'),0 - STRPUT,latlonstring,string(ABS(latmin),format='(f6.3)'),3 - STRPUT,latlonstring,string(ABS(londeg),format='(I3)'),12 - STRPUT,latlonstring,string(ABS(lonmin),format='(f6.3)'),16 - IF (FLOAT(latdeg)+latmin) LT 0. THEN STRPUT,latlonstring,'S',10 - IF (FLOAT(londeg)+lonmin) GE 0. THEN STRPUT,latlonstring,'E',23 - latlonstring2='36.000000N 74.000000W' - IF (latdec) LT 0. THEN STRPUT,latlonstring2,'S',9 - IF (londec) GE 0. THEN STRPUT,latlonstring2,'E',21 - STRPUT,latlonstring2,string(ABS(latdec),format='(f9.6)'),0 - STRPUT,latlonstring2,string(ABS(londec),format='(f10.6)'),11 -END - - -;---------------------------------------------------------------------------- -PRO LatLontoXY,latdeg,latmin,londeg,lonmin,x,y -;+ -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -COMMON MAPPOLE, XPOLE, YPOLE, SLAT, RE, E2, E -; -; NAME: LatlontoXY -; PURPOSE: converts latitude and longitude into X,Y coordinates -; (negative for west and south) -; with decimal minutes -; -; CALLING SEQUENCE: LatLontoXY,latdeg,latmin,londeg,lonmin -; INPUT: latdeg and londeg in degrees, latmin and lonmin in minutes -; OUTPUT: x and y in kilometers -; COMMON BLOCKS: bathy -;- -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -; - IF (MAPLONLAT EQ 2) THEN BEGIN - mapll,xx,yy,FLOAT(latdeg)+latmin/60.,FLOAT(londeg)+lonmin/60.,1 - X=xx+XPOLE - Y=yy+YPOLE - ENDIF ELSE BEGIN - lon=FLOAT(londeg)+(lonmin/60.) - IF lon-rlonmin GT 360 THEN lon=lon-360*(FLOOR((FLOAT(londeg)-rlonmin)/360)) - IF rlonmax-lon GT 360 THEN lon=lon-360*(FLOOR((rlonmax-FLOAT(londeg))/360)) - X=(nx-1)*dx*(lon-rlonmin)/ABS(rlonmax-rlonmin) - Y=(ny-1)*dy*(FLOAT(latdeg)+latmin/60.-rlatmin)/ABS(rlatmax-rlatmin) - ENDELSE -END - - - - -;----------------------------------------------------------------------------- -PRO NEAREST_POINT -;+ -; NAME: NEAREST_POINT -; PURPOSE: Finds nearest point either in a triangle-based grid or a regular grid -; (i.e. action on a widget) as they occur -; CALLING SEQUENCE: NEAREST_POINT - -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple - -;*******END OF COMMON BLOCKS******************************* -; - IF (FINITE(c_x) EQ 0) THEN BEGIN - lat=c_lat - lon=c_lon - print,'Looking for nearest point:',c_lon,c_lat - latdeg=FLOOR(lat) - IF latdeg LT 0 THEN latdeg=latdeg+1 - londeg=FLOOR(lon) - IF londeg LT 0 THEN londeg=londeg+1 - latmin=(lat-latdeg)*60. - lonmin=(lon-londeg)*60. - LatLontoXY,latdeg,latmin,londeg,lonmin,c_x,c_y - ENDIF -; - IF datastatus(5) THEN BEGIN ;changes the current grid point - c_gp=0 - distmin=(c_x-gridmat(0,0))^2+(c_y-gridmat(1,0))^2 - FOR I=1L,nngp-1 DO BEGIN - dist=(c_x-gridmat(0,I))^2+(c_y-gridmat(1,I))^2 - IF (dist LT distmin) THEN BEGIN - c_gp=I - distmin=dist - ENDIF - ENDFOR - c_x=gridmat(0,c_gp) - c_y=gridmat(1,c_gp) - c_gp=c_gp+1 - PRINT,'Nearest point from triangles:',c_gp - ENDIF ELSE BEGIN - WIDGET_CONTROL,Wright(11,1), SET_VALUE=STRCOMPRESS(STRING(c_x),/REMOVE_ALL) - c_i=MIN([MAX([nxzmin,ROUND(c_x/dx)]),nxzmax]) - c_j=MIN([MAX([nyzmin,ROUND(c_y/dy)]),nyzmax]) - c_x=dx*(c_i) - c_y=dy*(c_j) - PRINT,'Nearest point: (',c_i,',',c_j,')' - ENDELSE - XYtoLatLon,c_x,c_y,latdeg,latmin,londeg,lonmin,latlonstring,latlonstring2 - c_lat=latdeg+latmin/60. - c_lon=londeg+lonmin/60. - print,'Actual position of point:',c_lon,c_lat - print,'Actual position of point, X, Y in km:',c_x,c_y - - END - - - -;---------------------------------------------------------------------------- -PRO Speeds,H,f,cphi,cg,KH - - tpi=6.2831853 - sig=tpi*f - g=9.81 - a=H*sig*sig/g - ga=-1.84 - IF(a ge 1.) THEN BEGIN - yhat=a*(1.+1.26*exp(ga*a)) - t=exp((-2.)*yhat) - KH=a*(1.+2.*t*(1.+t)) - ENDIF ELSE BEGIN - KH=sqrt(a)*(1.+a/6.*(1+a/5.)) - ENDELSE - dk=KH/H - cphi=tpi*f/dk - cg=g*((a/KH)+KH*(1-(a/KH)^2))/(2.*sig) - - RETURN -END - -;---------------------------------------------------------------------------- -PRO Colorbar,levels,cbtit,truemin,truemax -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri - -; -; Position of the colorbar in the page (normalized coordinantes) -; - POSCB=[blx*cbblx*winx/mwinx,bly*cbbly*winy/mwiny,trx*cbtrx*winx/mwinx,bly*cbtry*winy/mwiny] - nulevels=N_ELEMENTS(levels)-addmini-addmaxi - ncolind2=SIZE(colorind) - ncolind=ncolind2(1) - xcb=levels(addmini:addmini+nulevels-1) - ycb=[1] - IF xcb(nulevels-1) GT xcb(0) THEN BEGIN - PLOT,xcb,ycb,XSTYLE=cbexrange+4,YSTYLE=4,XTICKS=cbnticks, $ - POSITION=POSCB,/NOERASE,XRANGE=[xcb(0),xcb(nulevels-1)],XTICK_GET=XV - AXIS,XAXIS=0,TICKLEN=-0.15,XTICKS=cbnticks,XSTYLE=cbexrange,XTITLE=cbtit, $$ - XRANGE=[xcb(0),xcb(nulevels-1)] - IF truemin GE xcb(0) THEN BEGIN - IF truemax GT xv(cbnticks) THEN BEGIN - FOR I=0,nulevels-2 DO $ - POLYFILL,[xcb(i),xcb(i),xcb(i+1),xcb(i+1)],[0,1,1,0],COLOR=colorind(I) - POLYFILL,[xv(cbnticks),xv(cbnticks),xcb(nulevels-1),xcb(nulevels-1)], $ - [0,1,1,0],COLOR=colorind(N_ELEMENTS(colorind)-2) - trix=[xv(cbnticks),1.05*xv(cbnticks)-0.05*xv(0),xv(cbnticks)] - triy=[1,0.5,0] - IF filloutofrange THEN POLYFILL,trix,triy,COLOR=colorind(N_ELEMENTS(colorind)-1) - PLOTS,trix,triy - FOR I=0,nulevels-2 DO $ - POLYFILL,[xcb(i),xcb(i),xcb(i+1),xcb(i+1)],[0,1,1,0],COLOR=colorind(I) - ENDIF ELSE BEGIN - FOR I=0,nulevels-2 DO $ - POLYFILL,[xcb(i),xcb(i),xcb(i+1),xcb(i+1)],[0,1,1,0],COLOR=colorind(I) - ENDELSE - ENDIF ELSE BEGIN - IF truemax LE xv(cbnticks) THEN BEGIN -; FOR I=0,nulevels-2 DO $ - FOR I=0,nulevels-3 DO $ - POLYFILL,[xcb(i),xcb(i),xcb(i+1),xcb(i+1)],[0,1,1,0],COLOR=colorind(I+1) - IF cbexrange EQ 0 THEN POLYFILL,[xv(0),xv(0),xcb(0),xcb(0)],[0,1,1,0],COLOR=colorind(0) - trix=[xv(0),1.05*xv(0)-0.05*xv(cbnticks),xv(0)] - triy=[1,0.5,0] - IF filloutofrange THEN POLYFILL,trix,triy,COLOR=colorind(0) - IF (datatype EQ 4) AND (plottype EQ 0) AND (adcoast) AND (xv(0) EQ 0) $ - THEN POLYFILL,trix,triy,color=0 - PLOTS,trix,triy - ENDIF ELSE BEGIN - TAILLE=SIZE(colorind); - INDMAX=TAILLE(1) - FOR I=0,nulevels-2 DO BEGIN - ; POLYFILL,[xcb(i),xcb(i),xcb(i+1),xcb(i+1)],[0,1,1,0],COLOR=MIN([colorind(I+1),ncolind-1]) - POLYFILL,[xcb(i),xcb(i),xcb(i+1),xcb(i+1)],[0,1,1,0],COLOR=colorind(MIN([INDMAX-1,I+1])) - ENDFOR - IF cbexrange EQ 0 THEN BEGIN - POLYFILL,[xv(cbnticks),xv(cbnticks),xcb(nulevels-1),xcb(nulevels-1)], $ - [0,1,1,0],COLOR=colorind(N_ELEMENTS(colorind)-1) - POLYFILL,[xv(0),xv(0),xcb(0),xcb(0)],[0,1,1,0],COLOR=colorind(0) - ENDIF - trix=[xv(cbnticks),1.05*xv(cbnticks)-0.05*xv(0),xv(cbnticks)] - triy=[1,0.5,0] -;TV IF filloutofrange THEN POLYFILL,trix,triy,COLOR=colorind(N_ELEMENTS(colorind)-2) - IF filloutofrange THEN POLYFILL,trix,triy,COLOR=colorind(N_ELEMENTS(colorind)-1) - PLOTS,trix,triy - trix=[xv(0),1.05*xv(0)-0.05*xv(cbnticks),xv(0)] - triy=[1,0.5,0] - IF filloutofrange THEN POLYFILL,trix,triy,COLOR=colorind(0) - IF (datatype EQ 4) AND (plottype EQ 0) AND (adcoast) AND (xv(0) EQ 0) $ - THEN POLYFILL,trix,triy,color=Navailcolor-4 - PLOTS,trix,triy - ENDELSE - ENDELSE - - AXIS,XAXIS=0,XTICKS=cbnticks,TICKLEN=1.,XTICKNAME=REPLICATE(' ',cbnticks+1,1),XSTYLE=cbexrange - AXIS,XAXIS=1,XTICKS=1,TICKLEN=0.,XTICKNAME=[' ',' '],XSTYLE=cbexrange - AXIS,YAXIS=0,YTICKS=1,TICKLEN=0.,YTICKNAME=[' ',' '],YSTYLE=1 - AXIS,YAXIS=1,YTICKS=1,TICKLEN=0.,YTICKNAME=[' ',' '],YSTYLE=1 - ENDIF -END - -;----------------------------------------------------------------------------- -PRO Drawframe,xtit0,xtit1,ytit0,ytit1,frame=imposed_frame -;+ -; NAME: -; Drawframe -; PURPOSE: -; Draws axes around plot -; CALLING SEQUENCE: -; Drawframe,frametype -; INPUTS: -; frametype: integer, specifies the type of frame -; 0:no frame -; 1:"normal" -; 2:mixed lat-lon and cartesian -; 3: -; COMMON BLOCKS: -; DRAWING,TITLES,BATHY -; FREQ,DIR,TIME -; COMMENTS -; The ranges must be already set by the variables rangex -; and rangey before calling this procedure -; MODIFICATION HISTORY: Created 10/3/99 -;----------------------------------------------------------------------------- -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT - - nonames=REPLICATE(' ',30) - nonames=REPLICATE(' ',30) - - IF N_ELEMENTS(imposed_frame) NE 0 THEN frame=imposed_frame ELSE $ - frame=1+MAPLONLAT - CASE frame of - 0: ; No frame - 1:BEGIN - tickn=REPLICATE(' ',30) - IF outxtit THEN xtit='x (km)' ELSE xtit=' ' - AXIS,XRANGE=rangex,XAXIS=0,XSTYLE=1,XTITLE=xtit, XMINOR=5 - AXIS,XRANGE=rangex,XAXIS=1,XSTYLE=1,XTICKNAME=tickn - IF outytit THEN ytit='y (km)' ELSE ytit=' ' - AXIS,YRANGE=rangey,YAXIS=0,YSTYLE=1,YTITLE=ytit,YMINOR=5 - AXIS,YRANGE=rangey,YAXIS=1,YSTYLE=1,YTICKNAME=tickn - END - 2:BEGIN - ; This frame shows Longitude on the X axis below the plot - ; And latitude on the y axix on the left of the plot - latdeg=0. - latmin=0. - londeg=0. - lonmin=0. - latlonstring='' - XYtoLatLon,rangex(0),rangey(0), $ - latdeg,latmin,londeg,lonmin,latlonstring - y2min=latdeg+latmin/60. - x2min=londeg+lonmin/60. - XYtoLatLon,rangex(1),rangey(1), $ - latdeg,latmin,londeg,lonmin,latlonstring - x2max=londeg+lonmin/60. - IF x2max LE x2min THEN x2max=x2max+360. - rangex2=[x2min,x2max] - rangey2=[y2min,latdeg+latmin/60.] - - ;**********x axes****************** - - IF (rangex2(1)*rangex2(0) LT 0) THEN BEGIN - ; If the range covers positive and neg. values - AXIS,XRANGE=rangex2,XAXIS=0,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=nonames - siz=SIZE(XV) - xnames=nonames(0:siz(1)-1) - IF outx2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name=' 75d `' - lonmin=XV(I) - londeg=FLOOR(lonmin) - IF londeg LT 0 AND (FLOAT(londeg)-lonmin LT -0.001) $ - THEN londeg=londeg+1 - lonmin=(lonmin-londeg)*60. - STRPUT,name,string(londeg,format='(I4)'),0 - STRPUT,name,string(ROUND(ABS(lonmin)),format='(I2)'),5 - xnames(I)=name - ENDFOR - ENDIF - IF outxtit THEN xtit='Longitude' ELSE xtit=' ' - ; Plots the axis with the longitude - AXIS,XRANGE=rangex2,XAXIS=0,XSTYLE=1,XMINOR=4,XTITLE=xtit, $ - XTICKNAME=xnames - AXIS,XRANGE=rangex2,XAXIS=1,XSTYLE=1,XMINOR=4, $ - XTICKNAME=nonames - ENDIF ELSE BEGIN - IF (ABS(FLOOR(rangex2(1))-FLOOR(rangex2(0))) GT 10) THEN BEGIN - ; If the range covers more than 10 degrees - AXIS,XRANGE=rangex2,XAXIS=0,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=nonames - siz=SIZE(XV) - xnames=nonames(0:siz(1)-1) - IF outx2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name=' 75d' - lonmin=XV(I) - londeg=FLOOR(lonmin) - IF londeg LT 0 AND (FLOAT(londeg)-lonmin LT -0.001) $ - THEN londeg=londeg+1 - STRPUT,name,string(ABS(londeg),format='(I3)'),0 - xnames(I)=name - ENDFOR - ENDIF - IF XV(0) LT 0 THEN hemi='W' ELSE hemi='E' - IF (ABS(FLOOR(rangex2(1))-FLOOR(rangex2(0))) GT 180) THEN BEGIN - IF outxtit THEN xtit='Longitude' ELSE xtit=' ' - ENDIF ELSE BEGIN - IF outxtit THEN xtit='Longitude ('+hemi+')' ELSE xtit=' ' - ENDELSE - ; Plots the axis with the longitude - AXIS,XRANGE=rangex2,XAXIS=0,XSTYLE=1,XMINOR=4,XTITLE=xtit, $ - XTICKNAME=xnames - AXIS,XRANGE=rangex2,XAXIS=1,XSTYLE=1,XMINOR=4, $ - XTICKNAME=nonames - ENDIF ELSE BEGIN - - IF (FLOOR(rangex2(1)) NE FLOOR(rangex2(0))) THEN BEGIN - ; If the range covers more than one degree - AXIS,XRANGE=rangex2,XAXIS=0,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=nonames - siz=SIZE(XV) - xnames=nonames(0:siz(1)-1) - IF outx2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name=' 75d40`' - lonmin=XV(I) - londeg=FLOOR(lonmin) - IF londeg LT 0 AND (FLOAT(londeg)-lonmin LT -0.001) $ - THEN londeg=londeg+1 - lonmin=(lonmin-londeg)*60. - STRPUT,name,string(ABS(londeg),format='(I3)'),0 - STRPUT,name,string(ROUND(ABS(lonmin)),format='(I2)'),4 - xnames(I)=name - ENDFOR - ENDIF - IF XV(0) LT 0 THEN hemi='W' ELSE hemi='E' - IF outxtit THEN xtit='Longitude ('+hemi+')' ELSE xtit=' ' - ; Plots the axis with the longitude - AXIS,XRANGE=rangex2,XAXIS=0,XSTYLE=1,XMINOR=4,XTITLE=xtit, $ - XTICKNAME=xnames - ENDIF ELSE BEGIN - ; If the range covers less than one degree - AXIS,XRANGE=rangex2*60.,XAXIS=0,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=nonames - siz=SIZE(XV) - xnames=nonames(0:siz(1)-1) - IF outx2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name='40.00`' - lonmin=XV(I) - londeg=FLOOR(lonmin/60.) - IF londeg LT 0 AND (FLOAT(londeg*60)-lonmin LT 0.001) $ - THEN londeg=londeg+1 - lonmin=(lonmin-londeg*60) - STRPUT,name,string(ABS(lonmin),format='(F5.2)'),0 - xnames(I)=name - ENDFOR - ENDIF - IF XV(0) LT 0 THEN hemi='W' ELSE hemi='E' - IF outxtit*outx2lab THEN xtit='Longitude ('+ $ - string(ABS(londeg),format='(I3)')+'d'+hemi+')' ELSE xtit=' ' - AXIS,XRANGE=rangex2*60,XAXIS=0,XSTYLE=1,XMINOR=4,XTITLE=xtit, $ - XTICKNAME=xnames - ENDELSE - IF outxtit*outx1lab THEN xtit='x (km)' ELSE xtit=' ' - ; Plots the axis with the kilometers - IF outX1lab THEN $ - AXIS,XRANGE=rangex,XAXIS=1,XSTYLE=1,XMINOR=5,XTITLE=xtit $ - ELSE AXIS,XRANGE=rangex,XAXIS=1,XSTYLE=1,XMINOR=5,XTITLE=xtit, $ - XTICKNAME=nonames - ENDELSE - ENDELSE - - ;**********y axes****************** - IF (rangey2(1)*rangey2(0) LT 0 AND ABS(FLOOR(rangey2(1)) -FLOOR(rangey2(0))) LE 10) THEN BEGIN - ;case where the range covers latitudes north and south of the equator - AXIS,YRANGE=rangey2,YAXIS=0,YSTYLE=5,YMINOR=4,YTICK_GET=YV, $ - YTICKNAME=nonames - siz=SIZE(YV) - ynames=nonames(0:siz(1)-1) - IF outy2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name=' 75d40` ' - latmin=YV(I) - latdeg=FLOOR(latmin) - IF latdeg LT 0 AND (FLOAT(latdeg)-latmin LT 0.001) THEN latdeg=latdeg+1 - latmin=(latmin-latdeg)*60. - STRPUT,name,string(ABS(latdeg),format='(I3)'),0 - STRPUT,name,string(ROUND(ABS(latmin)),format='(I2)'),4 - ynames(I)=name - ENDFOR - ENDIF - IF outytit THEN ytit='Latitude' ELSE ytit=' ' - AXIS,YRANGE=rangey2,YAXIS=0,YSTYLE=1,YMINOR=4,YTITLE=ytit, $ - YTICKNAME=ynames - AXIS,YRANGE=rangey2,YAXIS=1,YSTYLE=1,YMINOR=4, $ - YTICKNAME=nonames - ENDIF ELSE BEGIN - IF (ABS(FLOOR(rangey2(1)) -FLOOR(rangey2(0))) GT 10) THEN BEGIN - AXIS,YRANGE=rangey2,YAXIS=0,YSTYLE=5,YMINOR=4,YTICK_GET=YV, $ - YTICKNAME=nonames - siz=SIZE(YV) - ynames=nonames(0:siz(1)-1) - IF outy2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name='75d' - latmin=YV(I) - latdeg=FIX(latmin) - STRPUT,name,string(ABS(latdeg),format='(I2)'),0 - ynames(I)=name - ENDFOR - ENDIF - IF YV(0) LT 0 THEN hemi='S' ELSE hemi='N' - IF outytit THEN ytit='Latitude ('+hemi+')' ELSE ytit=' ' - AXIS,YRANGE=rangey2,YAXIS=0,YSTYLE=1,YMINOR=4,YTITLE=ytit, $ - YTICKNAME=ynames - AXIS,YRANGE=rangey2,YAXIS=1,YSTYLE=1,YMINOR=4, $ - YTICKNAME=nonames - ENDIF ELSE BEGIN - IF (FLOOR(rangey2(1)) NE FLOOR(rangey2(0))) THEN BEGIN - AXIS,YRANGE=rangey2,YAXIS=0,YSTYLE=5,YMINOR=4,YTICK_GET=YV, $ - YTICKNAME=nonames - siz=SIZE(YV) - ynames=nonames(0:siz(1)-1) - IF outy2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name='75d40` ' - latmin=YV(I) - latdeg=FLOOR(latmin) - IF latdeg LT 0 AND (FLOAT(latdeg)-latmin LT 0.001) THEN latdeg=latdeg+1 - latmin=(latmin-latdeg)*60. - STRPUT,name,string(ABS(latdeg),format='(I2)'),0 - STRPUT,name,string(ROUND(ABS(latmin)),format='(I2)'),3 - ynames(I)=name - ENDFOR - ENDIF - IF YV(0) LT 0 THEN hemi='S' ELSE hemi='N' - IF outytit THEN ytit='Latitude ('+hemi+')' ELSE ytit=' ' - AXIS,YRANGE=rangey2,YAXIS=0,YSTYLE=1,YMINOR=4,YTITLE=ytit, $ - YTICKNAME=ynames - ENDIF ELSE BEGIN - ;case where the range covers less than 1 degree - ;The degree number is written in the axis title - AXIS,YRANGE=rangey2*60.,YAXIS=0,YSTYLE=5,YMINOR=4,YTICK_GET=YV, $ - YTICKNAME=nonames - siz=SIZE(YV) - ynames=nonames(0:siz(1)-1) - IF outy2lab THEN BEGIN - FOR I=0,siz(1)-1 DO BEGIN - name='40.00`' - latmin=YV(I) - latdeg=FLOOR(latmin/60.) - IF latdeg LT 0 AND (FLOAT(latdeg*60)-latmin LT 0.001) THEN latdeg=latdeg+1 - latmin=(latmin-latdeg*60) - STRPUT,name,string(ABS(latmin),format='(F5.2)'),0 - ynames(I)=name - ENDFOR - ENDIF - IF YV(0) LT 0 THEN hemi='S' ELSE hemi='N' - IF outytit*outy2lab THEN ytit='Latitude ('+ $ - string(ABS(latdeg),format='(I2)')+'d'+hemi+')' ELSE ytit=' ' - AXIS,YRANGE=rangey2*60,YAXIS=0,YSTYLE=1,YMINOR=4,YTITLE=ytit, $ - YTICKNAME=ynames - ENDELSE - IF outytit*outy1lab THEN ytit='y (km)' ELSE ytit=' ' - IF outy1lab THEN $ - AXIS,YRANGE=rangey,YAXIS=1,YSTYLE=1,YMINOR=5,YTITLE=ytit $ - ELSE AXIS,YRANGE=rangey,YAXIS=1,YSTYLE=1,YMINOR=5,YTITLE=ytit, $ - YTICKNAME=nonames - ENDELSE - ENDELSE - - END - 3:BEGIN - PLOT,x,y,/NODATA,xstyle=1,ystyle=1, $ - XTITLE=xtitle,YTITLE=ytitle, TITLE=title,/NOERASE, $ - XRANGE=rangex,YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - 4:BEGIN - tickvals=[0.,30.,60.,90.,120.,150.,180.] - ticknames=['North','30','60','East','120','150','South'] - PLOT,x,y,/NODATA,xstyle=1,ystyle=1, $ - XTITLE=xtitle,YTITLE=ytitle, TITLE=title,$ - XRANGE=rangex,YRANGE=rangey, /NOERASE, $ - XTICKS=6,XTICKV=tickvals,XTICKNAME=ticknames,XMINOR=3, $ - YTICKS=6,YTICKV=tickvals,YTICKNAME=ticknames,YMINOR=3, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - 5:BEGIN - tickvals=[0.,30.,60.,90.,120.,150.,180.,210.,240.,270.,300.,330,360.] - ticknames=['North','30','60','East','120','150','South', $ - '210','240','West','300','330','North'] - PLOT,[0],[0],/NODATA,xstyle=1,ystyle=1, $ - XTITLE=xtitle,YTITLE=ytitle, TITLE=title,$ - XRANGE=rangex,YRANGE=rangey, /NOERASE, $ - YTICKS=12,YTICKV=tickvals,YTICKNAME=ticknames,YMINOR=3, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - 6:BEGIN - tickvals=[0.,30.,60.,90.,120.,150.,180.] - ticknames=['North','30','60','East','120','150','South'] - PLOT,[0],[0],/NODATA,xstyle=1,ystyle=1, $ - XTITLE=xtitle,YTITLE=ytitle, TITLE=title,$ - XRANGE=rangex,YRANGE=rangey, /NOERASE, $ - YTICKS=6,YTICKV=tickvals,YTICKNAME=ticknames,YMINOR=3, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - 7:BEGIN - ;tickn=REPLICATE(' ',30) - latdeg=0. - latmin=0. - londeg=0. - lonmin=0. - latlonstring='' - XYtoLatLon,rangex(0),rangey(0), $ - latdeg,latmin,londeg,lonmin,latlonstring - y2min=latdeg+latmin/60. - x2min=londeg+lonmin/60. - XYtoLatLon,rangex(1),rangey(1), $ - latdeg,latmin,londeg,lonmin,latlonstring - rangex2=[x2min,londeg+lonmin/60.] - rangey2=[y2min,latdeg+latmin/60.] - ;**********x axes****************** - xnames=REPLICATE(' ',30) - IF (rangey2(1)-rangey2(0)) GT 1. THEN BEGIN - AXIS,XRANGE=rangex2,XAXIS=1,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=xnames - siz=SIZE(XV) - xnames=STRARR(siz(1)) - FOR I=0,siz(1)-1 DO BEGIN - name='75d40`' - lonmin=XV(I) - londeg=FLOOR(lonmin) - IF londeg LT 0 AND (FLOAT(londeg)-lonmin LT -0.001) THEN londeg=londeg+1 - lonmin=(lonmin-londeg)*60. - STRPUT,name,string(ABS(londeg),format='(I2)'),0 - STRPUT,name,string(ROUND(ABS(lonmin)),format='(I2)'),3 - xnames(I)=name - ENDFOR - IF XV(0) LT 0 THEN hemi='W' ELSE hemi='E' - IF outxtit THEN xtit='Longitude ('+hemi+')' ELSE xtit=' ' - AXIS,XRANGE=rangex2,XAXIS=1,XSTYLE=1,XMINOR=4,XTITLE=xtit, $ - XTICKNAME=xnames - IF outxtit THEN xtit='x (km)' ELSE xtit=' ' - ENDIF ELSE BEGIN - AXIS,XRANGE=rangex2*60.,XAXIS=1,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=xnames - siz=SIZE(XV) - xnames=STRARR(siz(1)) - FOR I=0,siz(1)-1 DO BEGIN - name='40.00`' - lonmin=XV(I) - londeg=FLOOR(lonmin/60.) - IF londeg LT 0 AND (FLOAT(londeg*60)-lonmin LT 0.001) THEN londeg=londeg+1 - lonmin=(lonmin-londeg*60) - STRPUT,name,string(ABS(lonmin),format='(F5.2)'),0 - xnames(I)=name - ENDFOR - IF XV(0) LT 0 THEN hemi='W' ELSE hemi='E' - IF outxtit THEN xtit='Longitude ('+ $ - string(ABS(londeg),format='(I2)')+'d'+hemi+')' ELSE xtit=' ' - AXIS,XRANGE=rangex2*60,XAXIS=1,XSTYLE=1,XMINOR=4,XTITLE=xtit, $ - XTICKNAME=xnames - ENDELSE - END - 8:BEGIN - latdeg=0. - latmin=0. - londeg=0. - lonmin=0. - latlonstring='' - XYtoLatLon,rangey(0),rangex(0), $ - latdeg,latmin,londeg,lonmin,latlonstring - X2min=latdeg+latmin/60. - XYtoLatLon,rangey(1),rangex(1), $ - latdeg,latmin,londeg,lonmin,latlonstring - rangeX2=[X2min,latdeg+latmin/60.] - ;**********X axes****************** - Xnames=REPLICATE(' ',30) - IF (rangeX2(1)-rangeX2(0)) GT 1. THEN BEGIN - AXIS,XRANGE=rangeX2,XAXIS=1,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=Xnames - siz=SIZE(XV) - Xnames=STRARR(siz(1)) - FOR I=0,siz(1)-1 DO BEGIN - name='75d40` ' - latmin=XV(I) - latdeg=FLOOR(latmin) - IF latdeg LT 0 AND (FLOAT(latdeg)-latmin LT 0.001) THEN latdeg=latdeg+1 - latmin=(latmin-latdeg)*60. - STRPUT,name,string(ABS(latdeg),format='(I2)'),0 - STRPUT,name,string(ROUND(ABS(latmin)),format='(I2)'),3 - Xnames(I)=name - ENDFOR - IF XV(0) LT 0 THEN hemi='S' ELSE hemi='N' - IF outXtit THEN Xtit='Latitude ('+hemi+')' ELSE Xtit=' ' - AXIS,XRANGE=rangeX2,XAXIS=1,XSTYLE=1,XMINOR=4,XTITLE=Xtit, $ - XTICKNAME=Xnames - ENDIF ELSE BEGIN - AXIS,XRANGE=rangeX2*60.,XAXIS=1,XSTYLE=5,XMINOR=4,XTICK_GET=XV, $ - XTICKNAME=Xnames - siz=SIZE(XV) - Xnames=STRARR(siz(1)) - FOR I=0,siz(1)-1 DO BEGIN - name='40.00`' - latmin=XV(I) - latdeg=FLOOR(latmin/60.) - IF latdeg LT 0 AND (FLOAT(latdeg*60)-latmin LT 0.001) THEN latdeg=latdeg+1 - latmin=(latmin-latdeg*60) - STRPUT,name,string(ABS(latmin),format='(F5.2)'),0 - Xnames(I)=name - ENDFOR - IF XV(0) LT 0 THEN hemi='S' ELSE hemi='N' - IF outXtit THEN Xtit='Latitude ('+ $ - string(ABS(latdeg),format='(I2)')+'d'+hemi+')' ELSE Xtit=' ' - AXIS,XRANGE=rangeX2*60,XAXIS=1,XSTYLE=1,XMINOR=4,XTITLE=Xtit, $ - XTICKNAME=Xnames - ENDELSE - END - ENDCASE -RETURN -END - - -;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -pro makebin,xval,yval,rangex,rangey,nx,ny,bindata,bindataw,ibin,jbin,binweight=binweight - nel=N_elements(xval) - nely=N_elements(yval) - IF (nel EQ nely) THEN BEGIN - dx=(rangex(1)-rangex(0))/(nx-1) - dy=(rangey(1)-rangey(0))/(ny-1) - bindata=FLTARR(nx,ny) - bindataw=FLTARR(nx,ny) - ibin=INTARR(nel) - jbin=INTARR(nel) - FOR K=0L,nel-1 DO BEGIN - i=ROUND((xval(K)-rangex(0))/dx) - j=ROUND((yval(K)-rangey(0))/dy) - IF (I GT 0 AND I LT nx-1 AND J GT 0 AND J LT ny-1) THEN BEGIN - bindata(i,j)=bindata(i,j)+1 - IF keyword_set(binweight) THEN bindataw(i,j)=bindataw(i,j)+binweight(K) - ibin(K)=ROUND(i) - jbin(K)=ROUND(j) - ENDIF ELSE BEGIN - ibin(K)=-1 - jbin(K)=-1 - ENDELSE - ENDFOR - IF keyword_set(binweight) THEN BEGIN - KK=WHERE(bindata GE 1,kount) - IF (kount GT 0) THEN bindataw(KK)=bindataw(KK)/bindata(KK) - ENDIF - ENDIF ELSE BEGIN - print,'Cannot bin data, different sizes:',nel,nely - ENDELSE - RETURN -END - -;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -;---------------------------------------------------------------------------- -PRO Contorno,table,x,y,tit,xtit,ytit,cbtit,contoption,swap_palette,cbaxis, clev=clev, coli=coli, tri=tri -;+ -; NAME: -; Contorno -; PURPOSE: -; Plots a 2D array of data using various techniques -; CALLING SEQUENCE: -; Contorno,table,x,y,tit,cbtit,contoption,swap_palette -; INPUTS: -; table: the 2D data to be plotted -; x: x coordinate of the data -; y: y coordinate of the data -; tit: title of the plot -; cbtit: title for the color bar -; contoption: changes the fill technique for CONTOUR -; should be set to 1 for irregular grids -; swap_palette: -; COMMON BLOCKS: -; CONTOURPARAM,CURRENT... -; MODIFICATION HISTORY: Created 1/1/99-10/10/99 -;- -;** 1 ** Display parameters -common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON OVERLAY2,adbathydot,adcontour -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -;*******END OF COMMON BLOCKS******************************* - - tablep=table - IF (filltype GE 5) AND (filltype LE 7) AND (maxdepth EQ 1) THEN BEGIN - taille=size(tablep) - FOR I=0,taille(1)-1 DO BEGIN - tablep(I,*)=tablep(I,*)/x(I) ; division by the radial coordinate - ; to obtain densities for the polar plots - ENDFOR - taille=SIZE(tablep) - table2=FLTARR(taille(1)+1,taille(2)) ;+2.*maxval - table2(1:taille(1),*)=tablep ;adds one value for R so that - ;there will be no contours around R=0 - x2=FLTARR(taille(1)+1) - x2(1:taille(1))=x - x2(0)=MAX([0,2*x(0)-x(1)]) - tablep=tablep/max(tablep) - ENDIF - - index=WHERE(tablep GT maxval,kount) - table2=tablep - ;IF (kount GE 1) THEN table2(index)=-2.*maxval - truemin=min(tablep) - truemax=max(table2) - - IF logplot THEN BEGIN - indexminus=WHERE(tablep LT 0. AND tablep GT -1*maxval,kountminus) - indexplus=WHERE(tablep GT 0. AND tablep LT maxval,kountplus) - indexzero=WHERE(tablep EQ 0.,kountzero) - truemax=-25. - truemin=-30. - IF (kountplus GT 1) THEN BEGIN - truemin=MIN(ALOG10(tablep(indexplus))) - truemax=MAX(ALOG10(tablep(indexplus))) - ENDIF - IF (kountminus GT 1) THEN BEGIN - truemin2=MIN(ALOG10(-1.*tablep(indexminus))) - truemax2=MAX(ALOG10(-1.*tablep(indexminus))) - IF truemin2 LT truemin THEN truemin=truemin2 - IF truemax2 GT truemax THEN truemax=truemax2 - ENDIF - IF (kountzero GT 1) THEN truemin=-30. - cbtit='LOG10['+cbtit+']' - ENDIF - IF fixrange THEN BEGIN - mindata=mindepth - maxdata=maxdepth - ENDIF ELSE BEGIN - maxdata=MIN([truemax,maxdepth]) - mindata=MAX([truemin,mindepth]) - ENDELSE - IF (mindata LT maxdata) THEN BEGIN - IF outtit EQ 1 THEN title=tit ELSE title='' - - IF (MAPFLAG EQ 1) THEN CASE MAPPROJ OF - 0: MAP_SET,MAPLATCENTER,MAPLONGCENTER, /NOBORDER, /orthographic,/isotropic , /HORIZON, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - 1 :MAP_SET,MAPLATCENTER,MAPLONGCENTER, /NOBORDER, /mollweide,/isotropic , /HORIZON, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - 2 :MAP_SET,MAPLATCENTER,MAPLONGCENTER, /NOBORDER, /mercator,/isotropic, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - 3 :MAP_SET,MAPLATCENTER,MAPLONGCENTER, /NOBORDER, /azimuthal,/isotropic , /HORIZON, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDCASE - - CASE filltype OF - 0:BEGIN - IF keyword_set(clev) THEN BEGIN - taille=size(clev) - c_numlev=taille(1)-1 - table(0,0)=clev(c_numlev) - truemax=table(0,0) - addmaxi=1 - addmini=0 - lev=clev - colorind=coli - ENDIF ELSE BEGIN - c_numlev=numlevels - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(c_numlev-1+addmini+addmaxi) $ - *(Navailcolor-5)/(c_numlev+addmini+addmaxi-2) - ENDELSE - IF swap_palette THEN colorind=navailcolor-2-colorind - if cbar AND MAPFLAG EQ 0 THEN ColorBar,lev,cbtit,truemin,truemax - IF logplot THEN BEGIN - IF (kountplus GT 1) THEN tablep(indexplus)=ALOG10(tablep(indexplus)) - IF (kountminus GT 1) THEN tablep(indexminus)=ALOG10(-1.*tablep(indexminus)) - IF (kountzero GT 1) THEN tablep(indexzero)=-30. - indexsmall=WHERE(tablep LT -30., kountsmall) - IF (kountsmall GE 1) THEN tablep(indexsmall)=-30. - ENDIF - taille=size(lev) - doit=1 - trie=sort(lev) - FOR I=0,taille(1)-1 DO BEGIN - if trie(I) NE I THEN doit=0 - ENDFOR - IF doit AND lev(taille(1)-1) GT lev(0) THEN BEGIN - IF contoption EQ 0 THEN BEGIN - IF (MAPFLAG EQ 1) THEN BEGIN - - taille=SIZE(tablep) - nx=taille(1); - IF (rlonmax-rlonmin GT 360*(nx-1.2)/nx) THEN BEGIN - PRINT,'GLOBAL' - table2=FLTARR(nx+1,taille(2)) ; - table2(0:nx-1,*)=tablep - table2(nx,*)=tablep(0,*) - x2=FLTARR(taille(1)+1) - x2(0:nx-1,*)=x - x2(nx)=x(0) - x=x2 - tablep=table2 - ENDIF - CONTOUR,tablep,rlonmin+x*(rlonmax-rlonmin)/(max(x)-min(x)), $ - rlatmin+y*(rlatmax-rlatmin)/max(y),xstyle=5,ystyle=5,/FOLLOW,CELL_FILL=kount, $ - /FILL,C_COLOR=colorind(0:c_numlev-2+addmini+addmaxi), $ - LEVELS=lev, /NOERASE,TITLE=title, /overplot,MAX_VALUE=maxval - - c_numlev=numlevels - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(c_numlev-1+addmini+addmaxi) $ - *(Navailcolor-5)/(c_numlev+addmini+addmaxi-2) - - ENDIF ELSE BEGIN - CONTOUR,tablep,x,y,xstyle=5,ystyle=5, $ - /FILL,C_COLOR=colorind(0:c_numlev-2+addmini+addmaxi), $ - LEVELS=lev, /NOERASE,TITLE=title, $ - XRANGE=rangex,YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDELSE - ENDIF ELSE BEGIN - CONTOUR,tablep,x,y,$ - xstyle=5,ystyle=5, TRIANGULATION=tri, $ ; TRIANGULATION=tri2(0:2,0:16578), $ - /CELL_FILL,C_COLOR=colorind(0:c_numlev-2+addmini+addmaxi), $ - LEVELS=lev,/NOERASE,TITLE=title,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)], $ - XRANGE=rangex,YRANGE=rangey,MAX_VALUE=maxval, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDELSE - ENDIF - - - - END - 1:BEGIN ;Uses the TV procedure to diplay an image - IF contoption EQ 0 THEN BEGIN - c_numlev=Navailcolor-4 - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - toto=size(tablep) - image=1+ $ - BYTSCL(tablep,min=mindata,max=maxdata,Top=(navailcolor-5)) - IF swap_palette THEN BEGIN - image=navailcolor-2-image - colorind=navailcolor-2-colorind - ENDIF - if cbar AND MAPFLAG EQ 0 THEN ColorBar,lev,cbtit,truemin,truemax - IF (MAPFLAG EQ 0) THEN PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,TITLE=title, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - IF (output EQ 0) THEN BEGIN - - IF (MAPFLAG EQ 1) THEN BEGIN - result=MAP_IMAGE(image , $ - x0,y0,xx,yy, $ - LATMIN=rlatmin,LONMIN=rlonmin,LATMAX=rlatmax,LONMAX=rlonmax,COMPRESS=1 ) - TV, result,x0,y0 ;, xsize=(trx-blx)*winx,ysize=(try-bly)*winy,/device - ENDIF ELSE $ - TV,POLY_2D(image,$ - [[0,0],[(toto(1)+0.5)^2/((toto(1)+1.5)*winx*(trx-blx)),0]], $ - [[0,(toto(2)+0.5)^2/((toto(2)+1.5)*winy*(try-bly))],[0,0]],$ - keyword_set(interp),(trx-blx)*winx,(try-bly)*winy), $ - xsize=(trx-blx)*winx,ysize=(try-bly)*winy, $ - min(x),min(y),/data - ENDIF ELSE BEGIN - print,'min et max col:',min(image),max(image) - TV,image,blx*pssizex,bly*pssizey, $ - XSIZE=(trx-blx)*pssizex,YSIZE=(try-bly)*pssizey,/CENTIMETERS - ENDELSE - ENDIF - END - 2:BEGIN ; Uses Polyfill to draw squares filled with a color - taille=size(tablep) - IF (numlevels LT 0) THEN BEGIN - c_numlev=-numlevels - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(c_numlev-1+addmini+addmaxi) $ - *(Navailcolor-5)/(c_numlev+addmini+addmaxi-2) - IF swap_palette THEN colorind=navailcolor-2-colorind - COLORf=tablep*0. - FOR I=1,c_numlev-1 DO BEGIN - IND=WHERE (tablep GT lev(I-1) AND tablep LE lev(I),kount) - IF (kount GT 0) THEN COLORf(IND)=colorind(I-1) - ENDFOR - ENDIF ELSE BEGIN - c_numlev=Navailcolor-4 - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - COLORf=1+ROUND((Navailcolor-3)*(tablep-mindata)/(maxdata-mindata)) - - IF swap_palette THEN COLORf=navailcolor-2-COLORf - IND=WHERE (COLORF LT 1,kount) - IF (kount GT 0) THEN COLORF(IND)=1 - IND=WHERE (COLORF GT Navailcolor-3,kount) - IF (kount GT 0) THEN COLORF(IND)=Navailcolor-3 - IND=WHERE (tablep GT MAXVAL,kount) - IF (kount GT 0) THEN COLORF(IND)=Navailcolor-2 - ENDELSE - if cbar THEN ColorBar,lev,cbtit,truemin,truemax - PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,TITLE=title, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - i=0 - dx2=0.5*(x(1)-x(0)) ;for regular grids only - dy2=0.5*(y(1)-y(0)) - FOR J=0,taille(2)-1 DO BEGIN - firstx=0 - FOR i=0,taille(1)-1 DO BEGIN - IF (tablep(i,j) LT maxval) THEN BEGIN - - IF (firstx EQ 0) AND (COLORF(I,J) NE Navailcolor-2) THEN firstx=1 - IF (COLORf(I,J) LT Navailcolor) THEN BEGIN - im1=max([i-1,0]) - xim1=x(i)-dx2 - IF (im1 EQ i) THEN xim1=x(i) - ip1=min([i+1,taille(1)-1]) - xip1=x(i)+dx2 - IF (ip1 EQ i) THEN xip1=x(i) - - jm1=max([j-1,0]) - yjm1=y(j)-dy2 - IF (jm1 EQ j) THEN yjm1=y(j) - jp1=min([j+1,taille(2)-1]) - yjp1=y(j)+dy2 - IF (jp1 EQ j) THEN yjp1=y(j) - - xx=[xim1,xip1,xip1,xim1] - yy=[yjm1,yjm1,yjp1,yjp1] - IF firstx EQ 1 THEN POLYFILL,xx,yy, COLOR=COLORf(I,J),NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - ENDIF - - ENDIF - ENDFOR - ENDFOR - END - 3:BEGIN - c_numlev=numlevels - MakeLevels,mindata,maxdata,truemin,truemax - IF contoption EQ 0 AND kount EQ 0 THEN BEGIN - CONTOUR,tablep,x,y,xstyle=5,ystyle=5,/FOLLOW, $ - TITLE=tit,LEVELS=lev,/NOERASE,XRANGE=rangex,YRANGE=rangey, $ ; C_LABELS=[0] ,$ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDIF ELSE BEGIN - CONTOUR,tablep,x,y,TRIANGULATION=tri, $ - xstyle=5,ystyle=5, LEVELS=lev,/NOERASE,TITLE=title, $ - XRANGE=rangex,YRANGE=rangey,MAX_VALUE=maxval, $ - NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)], $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDELSE - END - 4:PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,TITLE=title, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - - 5:BEGIN ; makes a filled polar contour plot - IF logplot THEN BEGIN - IF (kountplus GE 1) THEN tablep(indexplus)=ALOG10(tablep(indexplus)) - IF (kountminus GE 1) THEN tablep(indexminus)=ALOG10(-1.*tablep(indexminus)) - IF (kountzero GE 1) THEN tablep(indexzero)=-30. - indexsmall=WHERE(tablep LT -30., kountsmall) - IF (kountsmall GE 1) THEN tablep(indexsmall)=-30. - ENDIF - c_numlev=numlevels ;number of contour levels - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(c_numlev-1+addmini+addmaxi) $ - *(Navailcolor-5)/(c_numlev+addmini+addmaxi-2) - IF swap_palette THEN colorind=navailcolor-1-colorind - ;print,'lev',lev - ;print,'colorind',colorind - ;print,'tablep',tablep(*,25) - yrad=(90.-y)*!dtor - PLOT,[x(0)],[y(0)],xstyle=4,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XTICK_GET=Radii, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - rangex=[-rangex(1),rangex(1)] - rangey=[-rangex(1),rangex(1)] - - Rescale,1 - POLAR_CONTOUR,TRANSPOSE(tablep),yrad,x,/FILL,XRANGE=rangex,$ - TITLE=title,YRANGE=rangey,POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - C_COLOR=colorind(1-filloutofrange*addmini: $ - numlevels-2+filloutofrange*(addmini+addmaxi)), $ - LEVELS=lev(1-filloutofrange*addmini: $ - numlevels-1-(1-filloutofrange)*addmaxi), $ - MAX_VALUE=maxval,/NOERASE - IF (logplot EQ 1) THEN $ - IF (kountplus GE 1) AND (kountminus GE 1) THEN BEGIN - - POLAR_CONTOUR,TRANSPOSE(table2),yrad,x2,XRANGE=rangex,$ - YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - LEVELS=[0],/NOERASE,C_LABEL=[0],THICK=2 - - XX=FLTARR(taille(2),taille(1)+1) - YY=FLTARR(taille(2),taille(1)+1) - FOR I=0,taille(1) DO XX(*,I)=COS(yrad(*)*!dtor)*x2(I) - FOR I=0,taille(1) DO YY(*,I)=SIN(yrad(*)*!dtor)*x2(I) - ENDIF - FOR I=0,N_ELEMENTS(Radii)-1 DO IF Radii(I) LE rangex(1) THEN BEGIN - acirc=FLTARR(N_ELEMENTS(yrad)+1) - acirc(0:N_ELEMENTS(yrad)-1)=yrad - acirc(N_ELEMENTS(yrad))=yrad(0) - OPLOT,Radii(I)*COS(acirc),Radii(I)*SIN(acirc),LINESTYLE=1, $ - NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - XYOUTS,-Radii(I),0,STRING(Radii(I),FORMAT='(f4.2)'),ALIGNMENT=0.5 - ENDIF - FOR I=0,5 DO OPLOT,rangex*COS(!pi*I/6.),rangex*SIN(!pi*I/6.), $ - LINESTYLE=((1+(I MOD 3))/2) - if cbar THEN ColorBar,lev,cbtit,truemin,truemax - PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey,/NOERASE, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - - 6:BEGIN - c_numlev=numlevels - MakeLevels,mindata,maxdata,truemax,truemin - yrad=(90.-y)*!dtor - PLOT,[x(0)],[y(0)],xstyle=4,ystyle=4,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XTICK_GET=Radii, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - rangex=[-rangex(1),rangex(1)] - rangey=[-rangex(1),rangex(1)] - Rescale,1 - IF logplot THEN BEGIN - IF (kountplus GE 1 and kountminus GE 1) THEN $ - POLAR_CONTOUR,TRANSPOSE(tablep),yrad,x,XRANGE=rangex,$ - TITLE=title,YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - LEVELS=[0],/NOERASE,TITLE=title,C_LABEL=[1],THICK=3 - - tableplot=tablep - tableplot(*,*)=2.*maxval - IF (kountplus GT 1) THEN BEGIN - tableplot(indexplus)=ALOG10(tablep(indexplus)) - POLAR_CONTOUR,TRANSPOSE(tableplot),yrad,x,XRANGE=rangex,$ - YRANGE=rangey,MAX_VALUE=maxval, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - LEVELS=lev,/NOERASE,TITLE=title,C_LABEL=[0, 1] - ENDIF - tableplot(*,*)=2.*maxval - IF (kountminus GT 1) THEN BEGIN - tableplot(indexminus)=ALOG10(tablep(-indexminus)) - POLAR_CONTOUR,TRANSPOSE(tableplot),yrad,x,XRANGE=rangex,$ - YRANGE=rangey,MAX_VALUE=maxval, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - LEVELS=lev,/NOERASE,TITLE=title,C_LABEL=[0, 1],LINESTYLE=1 - ENDIF - ENDIF ELSE BEGIN - taille=SIZE(tablep) - table2=FLTARR(taille(1)+1,taille(2))+2.*maxval - table2(1:taille(1),*)=tablep ;adds one value for R so that - ;there will be no contours around R=0 - linestyles=FIX(lev)*0. - linesthick=FIX(lev)*0.+1 - labels=FIX(lev)*0. - - Index=WHERE(lev LT 0,kount) - IF kount GE 1 THEN linestyles(index)=2. - - - POLAR_CONTOUR,TRANSPOSE(table2),yrad,x2,XRANGE=rangex,$ - YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - LEVELS=lev,C_LINESTYLE=linestyles,C_THICK=[2], $ - /NOERASE,TITLE=title,C_LABEL=[1],MAX_VALUE=maxval,C_CHARSIZE=1.2 - POLAR_CONTOUR,TRANSPOSE(table2),yrad,x2,XRANGE=rangex,$ - YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny, $ - trx*winx/mwinx,try*winy/mwiny],xstyle=5,ystyle=5, $ - LEVELS=[0],C_LINESTYLE=[0],C_THICK=[4],C_CHARTHICK=[2], $ - /NOERASE,TITLE=title,C_LABEL=[1],MAX_VALUE=maxval,C_CHARSIZE=1.2 - - ENDELSE - adpolarstuff=0 - IF adpolarstuff THEN BEGIN - XYOUTS,Rangex(0),Rangey(0),'Minimum: '+STRING(truemin,FORMAT='(E10.2)'), $ - ALIGNMENT=0. - XYOUTS,Rangex(1),Rangey(0),'Maximum: '+STRING(truemax,FORMAT='(E10.2)'), $ - ALIGNMENT=1. - FOR I=0,N_ELEMENTS(Radii)-1 DO BEGIN - IF Radii(I) LE rangex(1) THEN BEGIN - acirc=FLTARR(N_ELEMENTS(yrad)+1) - acirc(0:N_ELEMENTS(yrad)-1)=yrad - acirc(N_ELEMENTS(yrad))=yrad(0) - OPLOT,Radii(I)*COS(acirc),Radii(I)*SIN(acirc),LINESTYLE=1, $ - NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - XYOUTS,-Radii(I),0,STRING(Radii(I),FORMAT='(f4.2)'),ALIGNMENT=0.5 - ENDIF - ENDFOR - FOR I=0,5 DO OPLOT,rangex*COS(!pi*I/6.),rangex*SIN(!pi*I/6.), $ - LINESTYLE=((1+(I MOD 3))/2) - ENDIF - END - 7:BEGIN ; makes a filled polar contour plot using POLYFILL - taille=size(tablep) - c_numlev=Navailcolor-4 - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - PLOT,[x(0)],[y(0)],xstyle=4,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XTICK_GET=Radii, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - rangex=[-rangex(1),rangex(1)] - rangey=[-rangex(1),rangex(1)] - Rescale,1 - - PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey,/NOERASE, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - yrad=(90.-y)*!dtor - da=yrad(1)-yrad(0) - FOR i=0,taille(1)-1 DO BEGIN - IF I EQ 0 THEN dr1=(x(1)-x(0))/2. ELSE dr1=(x(i)-x(i-1))/2. - IF I EQ taille(1)-1 THEN dr2=(x(taille(1)-1)-x(taille(1)-2))/2. $ - ELSE dr2=(x(i+1)-x(i))/2. - - IF (x(I) LE rangex(1)) AND (dr1> 0) and (dr2> 0) THEN BEGIN - FOR J=0,taille(2)-1 DO BEGIN - x1=(x(i)-dr1)*cos(yrad(J)) - y1=(x(i)-dr1)*sin(yrad(J)) - x1=(x(i)-dr1)*cos(yrad(J)) - y1=(x(i)-dr1)*sin(yrad(J)) - dy=y(1)-y(0) - xx=[(x(i)-dr1)*cos(yrad(J)-da/2),(x(i)+dr2)*cos(yrad(J)-da/2), $ - (x(i)+dr2)*cos(yrad(J)+da/2),(x(i)-dr1)*cos(yrad(J)+da/2)] - yy=[(x(i)-dr1)*sin(yrad(J)-da/2),(x(i)+dr2)*sin(yrad(J)-da/2), $ - (x(i)+dr2)*sin(yrad(J)+da/2),(x(i)-dr1)*sin(yrad(J)+da/2)] - COLORf=1+(Navailcolor-5)*(tablep(i,J)-mindata)/(maxdata-mindata) - IF COLORF LT 1 THEN COLORF=1 - IF COLORF GT Navailcolor-4 THEN COLORF=Navailcolor-4 - POLYFILL,xx,yy, $ - COLOR=COLORf - ENDFOR - ENDIF - ENDFOR - ;XYOUTS,Rangex(0),Rangey(0),'Minimum: '+STRING(truemin,FORMAT='(E10.2)'), $ - ; ALIGNMENT=0. - ;XYOUTS,Rangex(1),Rangey(0),'Maximum: '+STRING(truemax,FORMAT='(E10.2)'), $ - ; ALIGNMENT=1. - FOR I=0,N_ELEMENTS(Radii)-1 DO IF Radii(I) LE rangex(1) THEN BEGIN - acirc=FLTARR(N_ELEMENTS(yrad)+1) - acirc(0:N_ELEMENTS(yrad)-1)=yrad - acirc(N_ELEMENTS(yrad))=yrad(0) - OPLOT,Radii(I)*COS(acirc),Radii(I)*SIN(acirc),LINESTYLE=1, $ - NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - XYOUTS,-Radii(I),0,STRING(Radii(I),FORMAT='(f4.2)'),ALIGNMENT=0.5 - ENDIF - FOR I=0,5 DO OPLOT,rangex*COS(!pi*I/6.),rangex*SIN(!pi*I/6.), $ - LINESTYLE=((1+(I MOD 3))/2) - if cbar THEN ColorBar,lev,cbtit,truemin,truemax - PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey,/NOERASE, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - - 8:BEGIN - pfontmemo=!P.font - !P.font=-1 - IF outxtit THEN xti=xtit ELSE xti=' ' - IF outytit THEN yti=ytit ELSE yti=' ' - IF outcbtit THEN cbti=cbtit ELSE cbti=' ' - SURFACE,(1-2*swap_palette)*tablep,x,y,AX=Ax3D,AZ=Az3D,XSTYLE=1,YSTYLE=1, $ - XTITLE=xti,YTITLE=yti,TITLE=ti,MAX_VALUE=maxval - !P.font=pfontmemo - END - - 9:BEGIN - c_numlev=Navailcolor-4 - MakeLevels,mindata,maxdata,truemin,truemax - toto=size(tablep) - image=1+ $ - BYTSCL(tablep,min=mindata,max=maxdata,Top=(navailcolor-3)) - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - IF swap_palette THEN BEGIN - image=navailcolor-2-image - colorind=navailcolor-2-colorind - ENDIF - if cbar THEN ColorBar,lev,cbtit,truemin,truemax - index1=WHERE(tablep GT maxdata,count1) - index2=WHERE(tablep LT mindata,count2) - IF count1 GT 0 THEN tablep(index1)=maxdepth - IF count2 GT 0 THEN tablep(index2)=mindepth - IF (smoothing GT 1) THEN tablep=SMOOTH(tablep,smoothing) - pfontmemo=!P.font - !P.font=-1 - IF outxtit THEN xti=xtit ELSE xti=' ' - IF outytit THEN yti=ytit ELSE yti=' ' - IF outcbtit THEN cbti=cbtit ELSE cbti=' ' - SHADE_SURF,(1-2*swap_palette)*tablep,x,y,shades=image,xstyle=1,ystyle=1, $ - XTITLE=xti,/NOERASE,MAX_VALUE=maxval, $ - YTITLE=yti, TITLE=ti,$ - XRANGE=rangex,YRANGE=rangey,/SAVE,Ax=ax3D,Az=az3D, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - !P.font=pfontmemo - END - - 10:BEGIN - index1=WHERE(tablep GT maxdata,count1) - index2=WHERE(tablep LT mindata,count2) - IF count1 GT 0 THEN tablep(index1)=maxdepth - IF count2 GT 0 THEN tablep(index2)=mindepth - IF (smoothing GT 1) THEN tablep=SMOOTH(tablep,smoothing) - pfontmemo=!P.font - !P.font=-1 - IF outxtit THEN xti=xtit ELSE xti=' ' - IF outytit THEN yti=ytit ELSE yti=' ' - IF outcbtit THEN cbti=cbtit ELSE cbti=' ' - - SHADE_SURF,(1-2*swap_palette)*tablep,x,y,xstyle=1,ystyle=1,/SAVE,Ax=ax3D,Az=az3D, $ - XTITLE=xti,/NOERASE,MAX_VALUE=maxval, $ - YTITLE=yti, TITLE=ti,$ - XRANGE=rangex,YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - !P.font=pfontmemo - END - 11:BEGIN - pfontmemo=!P.font - !P.font=-1 - IF outxtit THEN xti=xtit ELSE xti=' ' - IF outytit THEN yti=ytit ELSE yti=' ' - IF outcbtit THEN cbti=cbtit ELSE cbti=' ' - - SURFACE,(1-2*swap_palette)*tablep,x,y,MAX_VALUE=maxval, $ - AX=Ax3D,AZ=Az3D,/LEGO,XSTYLE=1,YSTYLE=1, $ - XTITLE=xti,YTITLE=yti,ZTITLE=cbti - !P.font=pfontmemo - IF outtit THEN ti=tit ELSE ti=' ' - XYOUTS,rangex(0)+0.5*(rangex(1)-rangex(0)), $ - rangey(1)-0.05*(rangey(1)-rangey(0)),ti,ALIGNMENT=0.5 - END - 12:BEGIN ; color bar only - c_numlev=Navailcolor-4 - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - toto=size(tablep) - IF swap_palette THEN BEGIN - colorind=navailcolor-2-colorind - ENDIF - if cbar THEN ColorBar,lev,cbtit,truemin,truemax - END - 13:BEGIN ; collapses the 2D plot into a 1D plot - taille=size(x) - y1=TOTAL(tablep,2)*(y(1)-y(0))*!dtor - print,'Hs:',4.*SQRT(TOTAL(y1*(x(1)-x(0)))) - print,'dtheta:',y(1)-y(0),!dtor - H=8. - cg=x - cg1=0. - kh=0. - cphi=0. - FOR I=0,taille(1)-1 DO BEGIN - Speeds,H,x(I),cphi,cg1,KH - cg(I)=cg1 - ENDFOR - print,'Cg:',cg - Eflux=0. - Etot=0. - FOR I=0,taille(1)-1 DO BEGIN - Eflux=Eflux+cg(I)*(y(1)-y(0))*!dtor*(x(1)-x(0))*TOTAL(tablep(I,*)*ABS(cos((70-y(*))*!dtor))) - ENDFOR - Eflux2=TOTAL(cg*TOTAL(tablep,1)*(y(1)-y(0))*!dtor*ABS(sin((90-y)*!dtor))*(x(1)-x(0))) - print,'Eflux:',Eflux,Eflux*1026.*9.81,TOTAL(cg*y1*(x(1)-x(0))),Eflux2 - plot,x,y1, $ - xstyle=1,ystyle=0,$ - /NOERASE,TITLE=' ',XTITLE=xtit,YTITLE='E(f) (m^2/Hz)',THICK=3, $ - XRANGE=rangex,YRANGE=[0,max(y1)],MAX_VALUE=maxval, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - END - ENDCASE - IF (filltype LE 3) AND (adcontour GT 0) THEN BEGIN ; Adds the contour lines corresponding to - lev2=mindata+(maxdata-mindata)*FINDGEN(cbnticks+1)/(cbnticks) - print,'LEV2:',lev2,'##',adcontour - Cstyle=FLTARR(cbnticks+1)+adcontour-1 - IF contoption EQ 0 AND MAPFLAG EQ 0 THEN $ - CONTOUR,tablep,x,y,xstyle=5,ystyle=5,/FOLLOW, $ - TITLE=tit,$ - LEVELS=lev2,C_LINESTYLE=Cstyle,/NOERASE,XRANGE=rangex,YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] $ - ELSE $ - CONTOUR,tablep,x,y,/IRREGULAR, $ - xstyle=5,ystyle=5,/FOLLOW, $ - LEVELS=lev2,C_LINESTYLE=Cstyle,/NOERASE,TITLE=title, $ - XRANGE=rangex,YRANGE=rangey,MAX_VALUE=maxval, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDIF - IF MAPFLAG EQ 1 THEN BEGIN - IF (adcontour) THEN BEGIN - c_numlev=numlevels - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(c_numlev-1+addmini+addmaxi) $ - *(Navailcolor-5)/(c_numlev+addmini+addmaxi-2) - - CONTOUR,tablep,rlonmin+x*(rlonmax-rlonmin)/max(x),rlatmin+y*(rlatmax-rlatmin)/max(y),xstyle=5,ystyle=5,/overplot,/FOLLOW, $ - LEVELS=lev - ENDIF - IF MAPCONTINENT GT 0 THEN MAP_CONTINENTS, FILL=MAPCONTINENT-1 - MAP_GRID,LATDEL=10, LONDEL=10,LONS=-170,LABEL=1 - if cbar THEN ColorBar,lev,cbtit,truemin,truemax - IF (title NE '') THEN XYOUTS,blx,try,title,/NORMAL - ENDIF - ENDIF ELSE BEGIN - PRINT,'Array is constant:',mindata - ENDELSE - -RETURN -END - -;---------------------------------------------------------------------------- -PRO Makelevels,mini,maxi,truemin,truemax -; Generates an increasing series of values from mini to maxi, used for -; contouring and the color bar. The true min and max are also used for cases -; in which the range of values of the displayed data goes beyond mini and maxi -; in that case the color bar may be extended by triangles to indicate that the -; range shown does not cover all the data (the parameters addmini and addmaxi -; are passed in the COLORBARPAR common block to the Colorbar procedure) -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec - addmini=0 - addmaxi=0 - IF (truemin LT mini) AND (fixrange GE 0) THEN addmini=1 - IF (truemax GT maxi) AND (fixrange GE 0) THEN addmaxi=1 - lev=FLTARR(c_numlev+addmini+addmaxi) - IF addmini THEN lev(0)=truemin-0.00001*(maxi-truemin) - IF addmaxi THEN lev(c_numlev+addmini+addmaxi-1)=truemax+0.00001*(truemax-mini) - ;print,'C_numlev:',c_numlev,addmini - CASE C_repart OF - 0: BEGIN - lev(addmini:c_numlev+addmini-1)=mini+(maxi-mini)*FINDGEN(c_numlev)/(c_numlev-1) - END - 1: BEGIN - toto=EXP(2*(FINDGEN(c_numlev)+1-c_numlev)/c_numlev) - mini2=toto(0) - lev(addmini:c_numlev+addmini-1)=mini+(maxi-mini)/(1-mini2) $ - *(EXP(2*(FINDGEN(c_numlev)+1-numlevels)/c_numlev)-mini2) - END - 2: BEGIN - toto=EXP(6.*(FINDGEN(c_numlev)+1-c_numlev)/c_numlev) - mini2=toto(0) - lev(addmini:c_numlev+addmini-1)=mini+(maxi-mini)/(1-mini2) $ - *(EXP(6.*(FINDGEN(c_numlev)+1-c_numlev)/c_numlev)-mini2) - END - 3: BEGIN - toto=EXP(5*(FINDGEN(c_numlev)+1-numlevels)/c_numlev) - mini2=toto(0) - lev(addmini:c_numlev+addmini-1)=mini+(maxi-mini)/(1-mini2) $ - *(EXP(5*(FINDGEN(c_numlev)+1-c_numlev)/c_numlev)-mini2) - END - 4: BEGIN - IF maxi LT 1.2 THEN BEGIN - lev(addmini:c_numlev+addmini-1)=mini+(maxi-mini)*FINDGEN(c_numlev)/(c_numlev-1) - ENDIF ELSE BEGIN - n1=c_numlev/2 - n2=2*n1 - lev(addmini:c_numlev+addmini-1)=mini+(1.2-mini)*FINDGEN(c_numlev)/(n1-1) - lev(n1:c_numlev-1+addmini)=1.2+ $ - (maxi-1.2)*(1.+FINDGEN(c_numlev-n1))/(c_numlev-n1) - ENDELSE - END - 5: BEGIN - logmax=FIX(MAX([ALOG10(abs(maxi)),ALOG10(abs(mini))]))+1 - lev(addmini:c_numlev+addmini-1)=mini+(maxi-mini)*FINDGEN(c_numlev)/(c_numlev-1) - END - ENDCASE -RETURN -END - - -;---------------------------------------------------------------------------- -PRO VECT,u,v,x,y,miss,rangex,rangey - s = size(u) - - r = .3 ;len of arrow head - angle = 22.5 * !dtor ;Angle of arrowhead - st = r * sin(angle) ;sin 22.5 degs * length of head - ct = r * cos(angle) -; arrow - xmotif=[0.,1.,1.-ct,1.,1.-ct]*(rangex(1)-rangex(0))/40. - ymotif=[0.,0.,st,0.,-st]*(rangex(1)-rangex(0))/40. - - mag=SQRT(u^2+v^2) - u0=u/mag - v0=v/mag - Index=WHERE(miss EQ 0 and x GT rangex(0) AND x LT rangex(1) $ - AND y GT rangey(0) AND y LT rangey(1),kount) - IF (kount GT 0) AND (kount LT 10000) THEN BEGIN - FOR i=0,kount-1 DO BEGIN - PLOTS,x(Index(I))+xmotif*u0(Index(I))-ymotif*v0(Index(I)), $ - y(Index(I))+xmotif*v0(Index(I))+ymotif*u0(Index(I)),THICK=2 - ENDFOR - ENDIF -END - -;---------------------------------------------------------------------------- -PRO ad2Dmisc -;**********DESCRIPTION**** -; This procedure overlays sympols and lines over 2d plots. -; Symbols can be grid points, special points, and arrows for wave direction -; lines can be bathymetry contours, rays, survey lines, coastline -; The flags governing the display (or not) of these are contain in the -; PLOTOP group of common variables -; This procedure is called by doplotothers after a backgroung plot -; has been produced. The coordinates for all symbols are in kilometers from the -; bottom left corner of the bathymetry grid. -;** 1 ** Display parameters -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri -COMMON OVERLAY2,adbathydot,adcontour -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - -;** 3 ** I/O and data variables -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON COAST, coastxy,coastl,coastnp,GSHHSPoly,GSHHSPoint,GSHHSPoly2,GSHHSPoint2 -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON TRIANGLE2,nzonetri,zonetri,nzonegp,zonegp,ngpzone,gpzone -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON TIMESTEPSUG,TIMESTEPS,NTIMESTEPS,FLAGTSTEP, TIMESTEPS_ORDER -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON MAPPOLE, XPOLE, YPOLE, SLAT, RE, E2, E - -COMMON XYZDATA, NXYZ, XYZ -;*******END OF COMMON BLOCKS******************************* - -; -; Plots xyz.dat -; - IF datastatus(1) THEN BEGIN - - index=WHERE(XYZ(*,2) GT maxval,kount) - table2=XYZ(*,2) - truemin=min(XYZ(*,2)) - truemax=max(table2) - IF fixrange THEN BEGIN - mindata=mindepth - maxdata=maxdepth - ENDIF ELSE BEGIN - maxdata=MIN([truemax,maxdepth]) - mindata=MAX([truemin,mindepth]) - ENDELSE - - c_numlev=Navailcolor-4 - MakeLevels,mindata,maxdata,truemin,truemax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - c_numlev=Navailcolor-4 - - FOR I=0,c_numlev+addmini+addmaxi-2 DO BEGIN - IND=WHERE(XYZ(*,2) GE lev(I) AND XYZ(*,2) LE lev(I+1),kount) - IF (kount GT 0) THEN OPLOT,XYZ(IND,0),XYZ(IND,1),psym=3, $ ; - linestyle=0,SYMSIZE=1,COLOR=I - ENDFOR - - ;ENDFOR - - ENDIF -; -; Adds shoreline -; - IF datastatus(4) OR datastatus(18) THEN BEGIN - taille=SIZE(GSHHSPoly) - Npoly=taille(1)-1 - CASE adcoast OF - 1: BEGIN - FOR I=0L,Npoly-1 DO BEGIN - IF GSHHSPoly(I,0) LT GSHHSPoly(I+1,0)-1 THEN BEGIN - COLORI=253.+(GSHHSPoly(I,3) MOD 2) - POLYFILL,GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,0), $ - GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,1), $ - COLOR=253.+(GSHHSPoly(I,3) MOD 2), $ - NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - drx=0; (rangex(1)-rangex(0))*0.25 - dry=0;(rangey(1)-rangey(0))*0.25 - ;,COLOR=Navailcolor-1 $ - ENDIF - ENDFOR - outdump=0 - IF (outdump EQ 1) THEN BEGIN - GET_LUN,unit2 - OPENW,unit2,'GSHHS_v2_islands_in_zoom.txt' - FOR I=0L,Npoly-1 DO BEGIN - XBOUNDS=(((FLOAT(GSHHSPoly(I,4:5))*1.E-6+180.) MOD 360)-180-rlonmin)/(ABS(rlonmax-rlonmin)/((nx-1)*dx)) - YBOUNDS= (FLOAT(GSHHSPoly(I,6:7))*1.E-6 -rlatmin)/(ABS(rlatmax-rlatmin)/((ny-1)*dy)) - IF ( XBOUNDS(0) GT rangex(0) AND XBOUNDS(1) LT rangex(1) AND $ - YBOUNDS(0) GT rangey(0) AND YBOUNDS(1) LT rangey(1) ) THEN BEGIN - PRINTF,unit2,FORMAT='(2I10)',GSHHSPoly(I+1,0)-GSHHSPoly(I,0), GSHHSPoly(I,1) - FOR J=GSHHSPoly(I,0),GSHHSPoly(I+1,0)-1 DO BEGIN - PRINTF,unit2,FORMAT='(2F11.6)', rlonmin+GSHHSPoint(J,0)*ABS(rlonmax-rlonmin)/((nx-1)*dx), $ - rlatmin+GSHHSPoint(J,1)*ABS(rlatmax-rlatmin)/((ny-1)*dy) - ENDFOR - ENDIF - ENDFOR - CLOSE,unit2 - FREE_LUN,unit2 - ENDIF - END - -1:BEGIN - FOR I=0L,Npoly-1 DO BEGIN - PLOTS,GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,0)+0*dx, $ - GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,1)-0*dy, $ - COLOR=253.+(GSHHSPoly(I,3) MOD 2),NOCLIP=0, THICK=2, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - IF (rangex(1)-rangex(0) LT 2 ) AND (adsyms GT 3) THEN BEGIN - STRA=STRARR(2) - STRA(0)=strcompress(string(I+1L)) - FOR J=GSHHSPoly(I,0),GSHHSPoly(I+1,0)-1 DO BEGIN - IF (adsyms GT 3 AND GSHHSPoint(J,0) GT rangex(0) and GSHHSPoint(J,0) LT rangex(1) $ - AND GSHHSPoint(J,1) GT rangey(0) AND GSHHSPoint(J,1) LT rangey(1) ) THEN BEGIN - STRA(1)=strcompress(string(1L+J-GSHHSPoly(I,0))) - strlab=STRJOIN(STRA,',') - XYOUTS,GSHHSPoint(J,0),GSHHSPoint(J,1),strlab, $ - CHARSIZE=0.5,NOCLIP=0,COLOR=253, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - ENDIF - ENDFOR - ENDIF - ENDFOR - END - -2:BEGIN - FOR I=0L,Npoly-1 DO BEGIN - IF (GSHHSPoly(I,3) MOD 2 EQ 1) THEN $ - PLOTS,GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,0)+0*dx, $ - GSHHSPoint(GSHHSPoly(I,0):GSHHSPoly(I+1,0)-1,1)-0*dy, $ - COLOR=253.+(GSHHSPoly(I,3) MOD 2),NOCLIP=0, THICK=2, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - ENDFOR - END - 0:BEGIN - END - ENDCASE - ENDIF - - IF datastatus(4) THEN BEGIN - taille=SIZE(GSHHSPoly2) - Npoly=taille(1)-1 - CASE adcoast OF - 1: BEGIN - FOR I=0L,Npoly-1 DO BEGIN - IF GSHHSPoly2(I,0) LT GSHHSPoly2(I+1,0)-1 THEN BEGIN - POLYFILL,GSHHSPoint2(GSHHSPoly2(I,0):GSHHSPoly2(I+1,0)-1,0)+dx*0, $ - GSHHSPoint2(GSHHSPoly2(I,0):GSHHSPoly2(I+1,0)-1,1)+dy*0, $ - COLOR=Navailcolor-2, NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - drx=0; (rangex(1)-rangex(0))*0.25 - dry=0;(rangey(1)-rangey(0))*0.25 - ;COLOR=252.+(GSHHSPoly2(I,3) MOD 2), $ - ; - ENDIF - ENDFOR - END - -1:BEGIN - FOR I=0L,Npoly-1 DO BEGIN - PLOTS,GSHHSPoint2(GSHHSPoly2(I,0):GSHHSPoly2(I+1,0)-1,0)+0*dx, $ - GSHHSPoint2(GSHHSPoly2(I,0):GSHHSPoly2(I+1,0)-1,1)-0*dy, $ - COLOR=251.+(GSHHSPoly2(I,3) MOD 2),NOCLIP=0, THICK=2, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - IF (rangex(1)-rangex(0) LT 2 ) AND (adsyms GT 3) THEN BEGIN - STRA=STRARR(2) - STRA(0)=strcompress(string(I+1L)) - FOR J=GSHHSPoly2(I,0),GSHHSPoly2(I+1,0)-1 DO BEGIN - STRA(1)=strcompress(string(1L+J-GSHHSPoly2(I,0))) - strlab=STRJOIN(STRA,',') - IF (adsyms GT 3 AND GSHHSPoint2(J,0) GT rangex(0) and GSHHSPoint2(J,0) LT rangex(1) $ - and GSHHSPoint2(J,1) GT rangey(0) and GSHHSPoint2(J,1) LT rangey(1) ) $ - THEN XYOUTS,GSHHSPoint2(J,0),GSHHSPoint2(J,1)+0.002*(I MOD 2L),strlab, $ - CHARSIZE=0.5,NOCLIP=0,COLOR=252, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - ENDFOR - ENDIF - ENDFOR - END - ELSE:BEGIN - END - ENDCASE - ENDIF - - -; -; Displays the triangle mesh -; - IF adtri GE 1 AND adtri LE 2 AND datastatus(6) THEN BEGIN - IIGP=INTARR(3) - FOR I=1L,ntri DO BEGIN -; -; Gets indices of the three points in the triangle -; - I1=TRIGP(I,1)-1 - I2=TRIGP(I,2)-1 - I3=TRIGP(I,3)-1 - IF ((I1 NE -1) AND (I2 NE -1) AND (I3 NE -1)) THEN BEGIN - X=[gridmat(0,I1),gridmat(0,I2),gridmat(0,I3),gridmat(0,I1)] - Y=[gridmat(1,I1),gridmat(1,I2),gridmat(1,I3),gridmat(1,I1)] - PLOTS,X,Y,NOCLIP=0, CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)],THICK=1 ;,COLOR=250 -; -; Plots the median dual cells -; - IF adtri EQ 2 THEN BEGIN - XG=MEAN(X(0:2)) - YG=MEAN(Y(0:2)) - PLOTS,XG,YG,PSYM=3,SYMSIZE=1,NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - OPLOT,[0.5*(X(0)+X(1)),XG,0.5*(X(1)+X(2)),XG,0.5*(X(2)+X(0))], $ - [0.5*(Y(0)+Y(1)) ,YG,0.5*(Y(2)+Y(1)) ,YG ,0.5*(Y(0)+Y(2))],LINESTYLE=1, $ - NOCLIP=0, CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)],THICK=1 - ENDIF - ENDIF - ENDFOR - ENDIF - - IF adtri EQ 3 AND datastatus(6) THEN BEGIN - ALLIND = UNIQ(SORT( [TRIGP(0:NTRI,1), TRIGP(0:NTRI,2), TRIGP(0:NTRI,3)] -1)); - X=[gridmat(0,ALLIND)] - Y=[gridmat(1,ALLIND)] - PLOTS,X,Y,LINESTYLE=-1,PSYM=8,SYMSIZE=0.3, $ - NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - ENDIF - - -; -; Draws the mesh contour line -; - IF adcoast EQ -1 THEN BEGIN - OK=0 - IF (n_elements(contourline) GT 5) THEN BEGIN - NP=n_elements(contourline) -; -; J0 is the index of first point in polygon -; - J0=contourline(2,0) - I=0L - FOR J=2,contourline(1,0) DO BEGIN - J1=contourline(J,0) - IF (J LT contourline(1,0)) THEN BEGIN - J2=contourline(J+1,0) - IF (contourline(J+1,1) LT 0) THEN BEGIN -; -; If this is negative: end of poygon: closing it back to J0 -; - J2=J0 - J0=J-1 - ENDIF - ENDIF ELSE J2 = J0 - x1=gridmat(0,J1) - y1=gridmat(1,J1) - x2=gridmat(0,J2) - y2=gridmat(1,J2) - PLOTS,[x1,x2],[y1,y2], $ ;HICK=4, $ - NOCLIP=0,CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)],COLOR=253+(I MOD 2L), THICK=2 - IF (J LT contourline(1,0)) THEN BEGIN - IF (contourline(J+1,1) LT 0) THEN I=I+1L - ENDIF - ENDFOR - ENDIF - ENDIF - - IF datastatus(7) THEN BEGIN - IF (adsyms GE 2) THEN BEGIN - NP=8 - A = FINDGEN(NP+1) * (!PI*2/FLOAT(NP)) ;Make a vector of 16 points, A[i] = 2pi/16. - USERSYM, COS(A), SIN(A), /FILL ;Define the symbol to be a filled circle - FOR I=1L,nngp DO BEGIN - OPLOT,[gridmat(0,i-1)],[gridmat(1,i-1)], $ - psym=psyms(0),SYMSIZE=psymsizes(0),NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - strlab=strcompress(string(I)) - IF (adsyms GT 3) THEN XYOUTS,gridmat(0,i-1),gridmat(1,i-1),strlab, $ - CHARSIZE=0.5,NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - ENDFOR - ENDIF - - IF (N_ELEMENTS(nspecgp) GT 0) THEN BEGIN - IF (adsyms MOD 2) AND (nspecgp GT 0) THEN BEGIN - FOR I=0,nspecgp-1 DO BEGIN - IF (specmat(7,I) GE 0) THEN BEGIN - IF specmat(9,I) GT 0 THEN BEGIN - OPLOT,[specmat(1,I)],[specmat(2,I)], $ - PSYM=specmat(9,I),SYMSIZE=specmat(8,I), THICK=specmat(10,I) - ENDIF ELSE BEGIN - OPLOT,specmat(1,I-1:I),specmat(2,I-1:I), $ - PSYM=specmat(9,I),SYMSIZE=specmat(8,I), $ - LINESTYLE=specmat(11,I), THICK=specmat(10,I),NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)]; - ENDELSE - deltax0=0. - deltay0=-0.1 - deltax=deltax0*(rangex(1)-rangex(0))/30. - deltay=deltay0*(rangex(1)-rangex(0))/40. - ; 1 point is 1/72 US inch or 0.0353 cm - IF output EQ 1 THEN deltay=deltay0*0.4*specmat(12,I)*basefontsize*0.0353 $ - *(rangex(1)-rangex(0))/(FLOAT(pssizex)*(trx-blx)) - IF I MOD 2 THEN BEGIN - deltay=-deltay0*(rangex(1)-rangex(0))/20. - IF output EQ 1 THEN deltay=-1.4*deltay0*specmat(12,I)*basefontsize*0.0353 $ - *(rangex(1)-rangex(0))/(FLOAT(pssizex)*(trx-blx)) - ENDIF - IF specmat(12,I) GT 0 THEN BEGIN - xout=specmat(1,I)+deltax - yout=specmat(2,I)+deltay - IF (xout GT rangex(0)) AND (xout LT rangex(1)) AND $ - (yout GT rangey(0)) AND (yout LT rangey(1)) THEN $ - XYOUTS,xout,yout,STRMID(specname(I),0,15),CHARSIZE=specmat(12,I),ALIGNMENT=0. ;, $ - ENDIF - ENDIF - ENDFOR - ENDIF - ENDIF ; end of test : (N_ELEMENTS(nspecgp) GT 0) - ENDIF - - IF datastatus(3) AND adbathy GT 0 THEN BEGIN - x=(findgen(nxzmax-nxzmin+1)+nxzmin)*dx - y=(findgen(nyzmax-nyzmin+1)+nyzmin)*dy - CASE adbathy OF - 1:CONTOUR,gd(nxzmin:nxzmax,nyzmin:nyzmax),x,y, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XSTYLE=5,YSTYLE=5, C_LINESTYLE=[1,1],C_LABELS=[1,1], $ - LEVELS=[30,50], $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - 2:CONTOUR,gd(nxzmin:nxzmax,nyzmin:nyzmax),x,y, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XSTYLE=5,YSTYLE=5, C_LINESTYLE=[0],C_LABELS=[1], $ - LEVELS=[300], $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - 3:CONTOUR,SMOOTH(gd(nxzmin:nxzmax,nyzmin:nyzmax),[10,10]),x,y, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XSTYLE=5,YSTYLE=5, C_LINESTYLE=[0],C_LABELS=[1,1,1], $ - LEVELS=[50,80,100], C_THICK=[2], $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - 4:CONTOUR,gd(nxzmin:nxzmax,nyzmin:nyzmax),x,y, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - XSTYLE=5,YSTYLE=5, C_LINESTYLE=[0],C_LABELS=[0], $ - LEVELS=[0,1000,2000,3000], C_THICK=[1], $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDCASE - ENDIF - - - IF N_ELEMENTS(raya) NE 0 THEN BEGIN - nrays=(rayamax-rayamin)/rayres+1 - nray0=(180+rayamin)/rayres - IF (raystype EQ 1) THEN BEGIN - N1=nray0 - N2=nray0+nrays-1 - ENDIF ELSE BEGIN - N1=0 - N2=nrays-1 - ENDELSE - nstepmax=MAX(raynsteps,Imax) - FOR I=N1,N2 DO BEGIN - doit=0 - CASE RaysOK OF - 0:doit=1 - 1:IF rayflag(I) THEN doit=1 - 2:IF rayflag(I) THEN doit=0 - 3:doit=0 - ENDCASE - IF doit THEN BEGIN - x0=[rayx(I,0)] - y0=[rayy(I,0)] - ;OPLOT,x0,y0,psym=1 - FOR J=1,raynsteps(I)-1 DO BEGIN - IF (rayx(I,J) GT rangex(0) and rayx(I,J) LT rangex(1) and $ - rayy(I,J) GT rangey(0) and rayy(I,J) LT rangey(1)) THEN BEGIN - - OPLOT,[x0,rayx(I,J)],[y0,rayy(I,J)],THICK=4, $ ;psym=-1, $ - linestyle=0,SYMSIZE=0.15 ;,COLOR=2+((J/10)MOD 8)*(Navailcolor-5)/6 - ENDIF - x0=rayx(I,J) - y0=rayy(I,J) - ENDFOR - IF raynsteps(I) GE 1 THEN OPLOT,[x0,x0],[y0,y0],psym=-6, $ - linestyle=0,THICK=4,SYMSIZE=0.4,NOCLIP=0 - x0=rayx(I,J) - y0=rayy(I,J) - ENDIF - ENDFOR - ENDIF - - - IF FLAGTSTEP THEN BEGIN - MAXS=MAX(TIMESTEPS(1,*)) - MINS=MAX(TIMESTEPS(1,*)) - - FOR I=NTIMESTEPS-1,0,-1 DO BEGIN - OPLOT,[TIMESTEPS(2,I)],[TIMESTEPS(3,I)],THICK=4, psym=4, $ ; *TIMESTEPS(1,I)/MAXS - linestyle=0,SYMSIZE=4,COLOR=Navailcolor-3-I - ENDFOR - ENDIF - - - IF transOK and adtr THEN BEGIN - PSIZES=FLTARR(Ntrans)+0.2 - PSIZES(0)=1. - Psizes(Ntrans-1)=1. - OPLOT,Xtrans,Ytrans,PSYM=transsym, $ - LINESTYLE=transline,THICK=transthick,SYMSIZE=transsymsize - ENDIF - IF adbathydot GT 0 THEN plot_dot_bathy - RETURN -END - -;---------------------------------------------------------------------------- -PRO doplot -;** 1 ** Display parameters -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -;*******END OF COMMON BLOCKS******************************* - - ERASE - WIDGET_CONTROL, Wdraw, SENSITIVE=1 - - CASE datatype OF - 0:print,'Plot not updated' - 4:doplotothers - ELSE:IF TOTAL(datastatus(10:13)) GE 1 THEN doplottimeseries - ENDCASE -END - -;---------------------------------------------------------------------------- -PRO wavepar_from_spectrum,Spec,freq,theta,df,dtheta,Hs,fp,thet,sigth - - nf=N_ELEMENTS(freq) - nth=N_ELEMENTS(theta) - a1=FLTARR(nf) - b1=FLTARR(nf) - IN2=FLTARR(nf) - thet=FLTARR(nf) - Etot=FLTARR(nf) - Etot1=FLTARR(nf) - Etot2=FLTARR(nf) - Etot3=FLTARR(nf) - Etot4=FLTARR(nf) - I1=WHERE(sin(theta*!dtor) < 0.) - I2=WHERE(sin(theta*!dtor) > 0.) - I3=WHERE(cos(theta*!dtor) < 0.) - I4=WHERE(cos(theta*!dtor) > 0.) -; I5=WHERE((-1.*cos(theta*!dtor)-0.8) > 0.) -; I5=WHERE((sin(theta*!dtor)) > 0.) - FOR I=0,nf-1 DO BEGIN -;Spec(I,I5)=0. - Etot(I)=TOTAL(Spec(I,*))*Df(I)*dtheta*!dtor - Etot1(I)=TOTAL(Spec(I,I1))*Df(I)*dtheta*!dtor - Etot2(I)=TOTAL(Spec(I,I2))*Df(I)*dtheta*!dtor - Etot3(I)=TOTAL(Spec(I,I3))*Df(I)*dtheta*!dtor - Etot4(I)=TOTAL(Spec(I,I4))*Df(I)*dtheta*!dtor - ENDFOR - ETOTW=TOTAL(ETOT1) - ETOTE=TOTAL(ETOT2) - ETOTN=TOTAL(ETOT3) - ETOTS=TOTAL(ETOT4) - ETOT2=TOTAL(ETOT) - PRINT,NF,ETOT2,', 4 QUAD W E S N:',4*ETOTW,4*ETOTE,4*ETOTN,4*ETOTS - PRINT,'R EW NS:',ETOTE/ETOTW,ETOTS/ETOTN - Hs=4*SQRT(Etot2) - ; COMPUTES BULK PARAMETERS, WITH THE REFLECTED WAVES REMOVED - ;Index=where((y GT 180) AND (y LT 360),kount) - ;IF kount GT 0 THEN table(*,index)=0. ;removes the reflected wave - Ef=TOTAL(Spec,2)*dtheta*!dtor ;frequency spectrum - Efmax=MAX(Ef,ifp) - fp=(freq(ifp)*Ef(ifp)+freq(max([ifp-1,0]))*Ef(max([ifp-1,0]))+ $ - freq(min([ifp+1,nf-1]))*Ef(min([ifp+1,nf-1]))) - if (FP NE 0) THEN $ - fp=fp/(Ef(ifp)+Ef(max([ifp-1,0]))+Ef(min([ifp+1,nf-1]))) - FOR I=0,nf-1 DO BEGIN - a1(I)=TOTAL(cos(theta(*)*!dtor)*spec(I,*))*dtheta*!dtor - b1(I)=TOTAL(sin(theta(*)*!dtor)*spec(I,*))*dtheta*!dtor - IN2(I)=TOTAL(spec(I,0:nth/2-1)*spec(I,nth/2:nth-1))*dtheta*!dtor/(Ef(I)^2) - thet(I)=ATAN(b1(I),a1(I)) - IF thet(I) < 0. THEN thet(I)=thet(I)+2.*!pi - ENDFOR - - ; Spread at peak - sigth=SQRT(ABS(2*(1-(a1(Ifp)*cos(thet(Ifp)) $ - +b1(Ifp)*sin(thet(ifp)))/Efmax)))/!dtor - thet=thet(ifp)/!dtor - PRINT,'I at fp:',IN2(ifp) - -END - - -;---------------------------------------------------------------------------- -PRO doplottimeseries -; -; Performs all plots based on time series data -; -; Method: first processes the data from modelled or observed time series -; then plots the data -; -; - three possible values for 'datatype': (1) observed, (2) modeled, or (3) comparison -; NB: other values (4) correspond to maps ... -; - three possible 'typ' of data: (2) f-theta spectra, (1) f-spectra, (0) parameters (Hs ...) - -;** 1 ** Display parameters -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON LANGUAGE, ilang,dictionnaire -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - -;** 2 ** Display and data variables/parameters -COMMON FREQ, freq,nfband,findex,findex2 -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize - -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat - -;** 3 ** I/O and data variables -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON LOCALY, Ymem,ymem2,ymem3,ymem4,ymem5 -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -;*******END OF COMMON BLOCKS******************************* - indext=0L+(tindex-1)*dtindex - indext2=0L+(tindex2-1)*dtindex - nt=0L+indext2-indext+1 - POSBOX=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - -ytit='' - nf=findex2-findex+1 - -; -; 1. manages type of data (1: observed, 2: modeled, 3: comparison) -; - CASE datatype OF - 1:BEGIN - dates0=*obs.dates - dates=dates0(indext:indext2) - nabin=obs.nabin - np=obs.np - nv=obs.nvar - nr=obs.nrun - typ=obs.typ - f=*obs.f - theta=*obs.theta - df=*obs.df - varname=strcompress((*obs.varnames)[plottype],/REMOVE_ALL) - pname=(*obs.pnames)[c_spec] - pnames=(*obs.pnames) - data0=(*obs.data) - data=data0(*,*,*,findex-1:findex2-1,0:nabin-1,indext:indext2) - flag0=*obs.flags - flags=flag0(indext:indext2) - END -; - 2:BEGIN - dates0=*modspec.dates - IF (indext GT indext2) THEN BEGIN - RETURN - ENDIF - dates=dates0(indext:indext2) - nv=modspec.nvar - nabin=modspec.nabin - np=modspec.np - nr=modspec.nrun - typ=modspec.typ - IF typ EQ 2 THEN BEGIN - U10=*modspec.pU10 - Udir=*modspec.pUdir - Curr=*modspec.pCurr - Currdir=*modspec.pCurrdir - depth=*modspec.pdepth - ENDIF - f=*modspec.f - theta=*modspec.theta - df=*modspec.df - flag0=*modspec.flags - varname=strcompress((*modspec.varnames)[plottype],/REMOVE_ALL) - pname=(*modspec.pnames)[c_spec] - pnames=(*modspec.pnames) - data0=(*modspec.data) - size0=size(data0) - f1=MIN([findex,size0(4)])-1 - f2=MIN([findex2,size0(4)])-1 -print,'TEST:',f1,f2,size(data0) - data=data0(*,*,*,f1:f2,0:nabin-1,indext:indext2) - flags=flag0(indext:indext2) - END -; - 3:BEGIN - IF (*om.dateo EQ !NULL) THEN BEGIN - PRINT,'No common dates: no plot.' - RETURN - ENDIF - dates0=(*obs.dates)[*om.dateo] - IF (indext LT 0) THEN indext=0 - - IF (indext GT indext2) THEN BEGIN - PRINT,'time index 1 > time index2:',indext,indext2 - RETURN - ENDIF - dates=dates0(indext:indext2) - - nv=om.nvar - nabin=obs.nabin - np=om.np - nr=obs.nrun - typ=modspec.typ - f=(*obs.f)[*om.fo] - df=(*obs.df)[*om.fo] - theta=*modspec.theta - data=FLTARR(1,np,nv,findex2-findex+1,nabin,nt) - data2=FLTARR(modspec.nrun,np,nv,findex2-findex+1,nabin,nt) - names=(*obs.varnames) - varname=strcompress(names((*om.vo)[plottype]),/REMOVE_ALL) - IF varname EQ 'sth1' THEN varname='sth1m' - pname=(*obs.pnames)[(*om.po)[c_spec]] - pnames=(*obs.pnames)[(*om.po)] - data0=(*modspec.data)*1.; - - FOR I=0L,nt-1 DO $ - IF ((*modspec.flags)[indext+I] NE 0) THEN BEGIN - J=0L+(*om.datem)[indext+I] - data2(*,*,*,*,*,I)= $ - data0(*,*om.pm,*om.vm,(*om.fm)[findex-1:findex2-1],0:nabin-1,J); - ENDIF - data0=(*obs.data) - ;I=WHERE(data0 NE 0) - ;data0(I)=1./data0(I) - FOR I=0L,nt-1 DO $ - IF ((*modspec.flags)[indext+I] NE 0) THEN $ - data(0,*,*,*,*,I)= $ - data0(0,*om.po,*om.vo,(*om.fo)[findex-1:findex2-1],0:nabin-1,(*om.dateo)[indext+I]) - flag0=*modspec.flags - flags=flag0(indext:indext2) - END - ENDCASE - -; -; 2. manages typ of data (2: 2D spectra, 1: 1D spectra ... -; -; -; Frequency-direction spectrum -; - IF typ EQ 2 THEN BEGIN - IF (c_cut EQ 5) THEN BEGIN - rangex=[min(F),max(F)] - x=f(findex-1:findex2-1) - y=theta/!dtor - rangey=[min(y),max(y)] - ; Restricts the frequency range to that of the model if defined - rangex=[min(x),max(x)] - Rescale,0 - yp=FLTARR(findex2-findex+1,modspec.nabin) - yp(*,*)=data(0,c_spec,plottype,*,*,0) - ats='at' - ; ats=dictionnaire.at(ilang) - ;tit=varname+' '+ats+' '+pname - tit=varname+' '+'at'+' '+pname - xtit='f (Hz)' - ytit='Compass direction (from) in degrees ' - cbtit='Energy density (m^2/Hz/rad)' - taille2=size(yp) - Contorno,yp,x,y,tit,xtit,' ',' ',0,0,1 - IF (filltype LE 4) THEN Drawframe,xtit,' ',ytit,' ',FRAME=5 -; - spec2D=yp - timec=((dates[0].h+timezone_plot-dates[0].zone)*60+dates[0].minu) - TimetoDate,dates[0].jday,timec,date,hour - strlab3=date+' '+hour - XYOUTS,rangex(0)+0.95*(rangex(1)-rangex(0)), $ - rangey(1)-0.05*(rangey(1)-rangey(0)),strlab3,ALIGNMENT=1.0 -; - IF varname EQ 'E(,)' THEN BEGIN - r = .3 ;len of arrow head - angle = 22.5 * !dtor ;Angle of arrowhead - st = r * sin(angle) ;sin 22.5 degs * length of head - ct = r * cos(angle) - ; arrow - xmotif=[0.,1.,1.-ct,1.,1.-ct] - ymotif=[0.,0.,st,0.,-st] - - - u0=2*cos((90-Udir(c_spec,indext))*!dtor)*x(1) - v0=2*sin((90-Udir(c_spec,indext))*!dtor)*x(1) - IF (U10(c_spec,indext) GT 0) THEN PLOTS,u0*(1-xmotif)+v0*ymotif, $ - v0*(1-xmotif)-U0*ymotif,THICK=4 - u0=-2*cos((90-Currdir(c_spec,indext))*!dtor)*x(1) - v0=-2*sin((90-Currdir(c_spec,indext))*!dtor)*x(1) - IF (Curr(c_spec,indext) GT 0) THEN PLOTS,u0*(xmotif)+v0*ymotif, $ - v0*(xmotif)-U0*ymotif,THICK=2,LINESTYLE=0 - - - df2=df(findex-1:findex2-1) - dtheta=360/N_ELEMENTS(Y) - Hs=0. - fp=0. - thet=0. - sigth=0. -; -; Computes bulk parameters from spectrum -; - wavepar_from_spectrum,yp,x,y,df2,dtheta,Hs,fp,thet,sigth -; -; Overlays parameter values on plot -; - strlab='Hs:'+STRCOMPRESS(STRING(Hs,FORMAT='(F5.2)'))+'m' - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.05*(rangey(1)-rangey(0)),strlab - strlab='fp:'+STRCOMPRESS(STRING(Fp,FORMAT='(F6.4)'))+' Hz' - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.1*(rangey(1)-rangey(0)),strlab - strlab='Mean dir. at fp: ' $ - +STRCOMPRESS(STRING(thet,FORMAT='(F6.2)')) +' deg' - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.15*(rangey(1)-rangey(0)),strlab - strlab='Spread at fp: ' $ - +STRCOMPRESS(STRING(sigth,FORMAT='(F5.2)')) +' deg' - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.2*(rangey(1)-rangey(0)),strlab - - strlab='U10: ' $ - +STRCOMPRESS(STRING(U10(c_spec,indext),FORMAT='(F5.2)'))+' m/s' - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.25*(rangey(1)-rangey(0)),strlab - - strlab='Curr: ' $ - +STRCOMPRESS(STRING(Curr(c_spec,indext),FORMAT='(F5.2)'))+' m/s' - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.3*(rangey(1)-rangey(0)),strlab - ENDIF - RETURN - ENDIF ELSE BEGIN -; -; Integrated the f,theta spectrum over directions -; - tempo=TOTAL(data,5)*abs(theta(1)-theta(0)) - nabin=1 - data=FLTARR(nr,np,nv,findex2-findex+1,nabin,indext2-indext+1) - data(*,*,*,*,0,*)=tempo - typ=1 - varname='Ef' - ENDELSE - ENDIF - - - - - ;***************************************************************** - ; The following section determines the appearance of the x-axis - ; for time series: ticks, labels, dates, ... - ;***************************************************************** - xposi=0. - xnminor=1 - IF (c_cut LE 1) OR (c_cut EQ 4) OR (c_cut EQ 5 and typ EQ 1) THEN BEGIN -; -; Prepares data for time series plot: the x-axis is time -; - IF (FLOOR(dates[0].jday-0.5) EQ FLOOR(dates[nt-1].jday-0.5)) THEN BEGIN -; -; all the data is from the same day, therefore the -; x-axis shows hours, and the x-label indicates the date. -; - xtit='Hours ('+months(ilang,dates[0].m-1)+' '+ $ - STRING(dates[0].d,FORMAT='(I2)')+', '+ STRING(dates[0].y,FORMAT='(I4)')+')' - rangex=[dates[0].h,dates[nt-1].h + 1] - xnticks=dates[nt-1].h+1-dates[0].h - ;print,dates[0].h,dates[nt-1].h+1,xnticks - xnames=[''] - xposi=[0] - x=dates.h+dates.minu/60.+dates.s/3600. - ENDIF ELSE BEGIN - x=dates.jday-0.5-LONG(dates[0].jday-0.5); +((dates[0].h+dates[0].minu/60.+dates[0].s/3600.)/24.) - ; IF x(0) GE 1 THEN x=x-1. - IF (dates[0].m EQ dates[nt-1].m AND dates[0].y EQ dates[nt-1].y) THEN BEGIN -; -; Here all the data is from the same month: the ticks are the -; 00:00 hour at the end of each day, and the tick labels (day numbers) are shifted to appear between two ticks -; - rangex=[0,dates[nt-1].d-dates[0].d+ 1] -; xtit=dictionnaire.days(ilang)+' ('+months(ilang,dates[0].m-1)+' '+ STRING(dates[0].y,FORMAT='(I4)')+')' - xtit='days'+' ('+months(ilang,dates[0].m-1)+' '+ STRING(dates[0].y,FORMAT='(I4)')+')' - xnticks=dates[nt-1].d+1-dates[0].d - IF (xnticks LE 10) THEN xnminor=4 - IF (xnticks LE 3) THEN xnminor=24 - xnames=STRING(FINDGEN(xnticks)+dates[0].d,FORMAT='(I2)') -; -; Position of ticks on the date (x) axis -; - xposi=FINDGEN(xnticks)+0.5 - xntickval=FINDGEN(xnticks+1) - ENDIF ELSE BEGIN - rangex=[0,CEIL(max(x))] -; xtit=dictionnaire.days(ilang)+' ('+STRING(dates[0].y,FORMAT='(I4)')+')' - xtit='days'+' ('+STRING(dates[0].y,FORMAT='(I4)')+')' -; -; defines maximum number of days for writing dates -; - jmax=62 - IF (axis_orient EQ 1) THEN jmax=124 - IF ((dates[nt-1].Jday-dates[0].Jday) LT jmax) THEN BEGIN - xnticks=rangex(1) - ;dj=2; - dj=1+xnticks/15 - IF (axis_orient EQ 1) THEN dj=2; %1+xnticks/30 - xnminor=dj - xnticks=xnticks/dj - CALDAT,FINDGEN(xnticks)*dj+dates[0].jday,m,d,y - xnames=STRARR(xnticks) - FOR I=0,xnticks-1 DO BEGIN - IF (m(I) LT 10) THEN ms=STRING(m(I),FORMAT='(I1)') ELSE ms=STRING(m(I),FORMAT='(I2)') - IF (ilang EQ 0) THEN $ - xnames(I)=ms+'/'+STRING(d(I),FORMAT='(I2)') $ - ELSE xnames(I)=STRING(d(I),FORMAT='(I2)')+'/'+ms - ENDFOR - xntickval=FINDGEN(xnticks+1)*dj - xposi=FINDGEN(xnticks)*dj+0.5 - IF (axis_orient EQ 1) THEN xposi=xposi+0.4 - - ENDIF ELSE BEGIN - j1=JULDAY(dates[nt-1].m,1,dates[nt-1].y) - j0=JULDAY(dates[0].m,1,dates[0].y) - xnticks=LONG(dates[nt-1].jday)+1-LONG(dates[nt-1].jday) - IF (xnticks GT 59) THEN xnticks=xnticks/2 - IF (xnticks > 60) THEN xnticks=xnticks/2 - xnposi=FIX((j1-j0)/29.5) - rangex=[j0-dates[0].jday,j1-dates[0].jday] - xposi=FINDGEN(xnposi)*29.5+14.5+rangex(0) - CALDAT,xposi+dates[0].jday,m,d,y - ;print,'months',m - xnames=months(ilang,m-1) - xntickval=FINDGEN(xnticks+1) - ENDELSE - IF (xnticks LE 10) THEN xnminor=4 - ENDELSE - xtnames=REPLICATE(' ',xnticks+1) - ENDELSE - ENDIF -; - IF typ EQ 1 THEN BEGIN ; for frequency-dependent variables - y0=FLTARR(nr,np,findex2-findex+1,nt) - y0w=FLTARR(nr,np,findex2-findex+1,nt) - y0(*,*,*,*)=data(*,*,plottype,*,0,*) - y0w(*,*,*,*)=data(*,*,0,*,0,*) - y0d=y0w; - TAILLE=SIZE(data) - IF (TAILLE(3) GE 2) THEN y0d(*,*,*,*)=data(*,*,1,*,0,*) - IF (datatype EQ 3) THEN BEGIN - y02=FLTARR(modspec.nrun,np,findex2-findex+1,nt) - y02w=FLTARR(modspec.nrun,np,findex2-findex+1,nt) - y02(*,*,*,*)=data2(*,*,plottype,*,0,*) - y02w(*,*,*,*)=data2(*,*,0,*,0,*) - y02d=y02w; - IF (TAILLE(3) GE 2) THEN y02d(*,*,*,*)=data2(*,*,1,*,0,*) - y2=FLTARR(modspec.nrun,np,nt) - ENDIF - y=FLTARR(nr,np,nt) -; - CASE varname OF - 'Ef': BEGIN - IF (bulktype EQ 3) THEN BEGIN - Isth=-1 - IF (datatype NE 1) THEN BEGIN ; case of model data - FOR J=modspec.nvar-1,0,-1 DO BEGIN - var3=STRMID((*modspec.varnames)[J],0,4) - IF STRPOS(var3,'sth1') GT -1 THEN Isth=J - ENDFOR - ENDIF ELSE BEGIN - FOR J=obs.nvar-1,0,-1 DO BEGIN ; case of obs. - var3=STRMID((*obs.varnames)[J],0,4) - IF STRPOS(var3,'sth1') GT -1 THEN Isth=J - ENDFOR - ENDELSE - y01=FLTARR(nr,np,findex2-findex+1,nt) - IF (Isth GE 0) THEN y01(*,*,*,*)=data(*,*,Isth,*,0,*) - ENDIF ; (bulktype EQ 3) -; GET_LUN,unit1 -; OPENW,unit1,'buoy.txt' - FOR I=0,nt-1 DO BEGIN - FOR J=0,np-1 DO BEGIN - FOR K=0,nr-1 DO BEGIN -; -; Computes the bulk parameters according to the chosen moment: E(f), E(f)*f^4 ... -; - IF (bulktype EQ 0) THEN $ - y(k,J,I)=4.*SQRT(TOTAL(y0(K,J,*,I)*df(findex-1:findex2-1))) - IF (bulktype EQ 1) THEN $ - y(k,J,I)=TOTAL((2*!pi*freq(findex-1:findex2-1))^4*y0(K,J,*,I)*df(findex-1:findex2-1))/9.81^2 - IF (bulktype EQ 2) THEN $ - y(k,J,I)=2.*TOTAL((2*!pi*freq(findex-1:findex2-1))^3*y0(K,J,*,I)*df(findex-1:findex2-1))/9.81 - IF (bulktype EQ 3) THEN $ - y(k,J,I)=2.*TOTAL((2*!pi*freq(findex-1:findex2-1))^3*y0(K,J,*,I) $ - *df(findex-1:findex2-1)*(1-0.5*(y01(K,J,*,I)*!dtor)^2))/9.81 - IF (bulktype EQ 4) THEN $ - y(k,J,I)=MEAN((2*!pi)^4*freq(findex-1:findex2-1)^5*y0(K,J,*,I))/9.81^2 - IF (bulktype EQ 5) THEN y(k,J,I)=TOTAL((2*!pi*freq(findex-1:findex2-1))^2*y0(K,J,*,I)*df(findex-1:findex2-1)) - IF (bulktype EQ 6) THEN BEGIN - m1=TOTAL((freq(findex-1:findex2-1))^1*y0(K,J,*,I)*df(findex-1:findex2-1)) - m0=TOTAL(y0(K,J,*,I)*df(findex-1:findex2-1)) - y(k,J,I)=m0/m1 -; PRINTF,unit1,dates[I].y,dates[I].m,dates[I].d,dates[I].h,m1,y(k,J,I) - ENDIF - IF (bulktype EQ 7) THEN BEGIN - m2=TOTAL((freq(findex-1:findex2-1))^(2)*y0(K,J,*,I)*df(findex-1:findex2-1)) - m0=TOTAL(y0(K,J,*,I)*df(findex-1:findex2-1)) - y(k,J,I)=(m0/m2)^(0.5) - ENDIF - ENDFOR - ENDFOR - ENDFOR -; close,unit1 -; FREE_LUN,unit1 - - yp2=FLTARR(nt) - FOR I=0,nt-1 DO BEGIN - yp2(I)=4.*SQRT(TOTAL(y0(0,0,*,I)*df(findex-1:findex2-1))) - ENDFOR - IF (datatype EQ 3) THEN BEGIN - IF (bulktype EQ 3) THEN BEGIN - y01=FLTARR(modspec.nrun,np,findex2-findex+1,nt) - y01(*,*,*,*)=data2(*,*,Isth,*,0,*) - ENDIF -; GET_LUN,unit1 -; OPENW,unit1,'model.txt' - FOR I=0,nt-1 DO BEGIN - FOR J=0,np-1 DO BEGIN - FOR K=0,modspec.nrun-1 DO BEGIN - IF (bulktype EQ 0) THEN $ - y2(K,J,I)=4.*SQRT(TOTAL(y02(K,J,*,I)*df(findex-1:findex2-1))) - IF (bulktype EQ 1) THEN $ - y2(K,J,I)=TOTAL((2*!pi*freq(findex-1:findex2-1))^4*y02(K,J,*,I)*df(findex-1:findex2-1))/9.81^2 - IF (bulktype EQ 2) THEN $ - y2(K,J,I)=2.*TOTAL((2*!pi*freq(findex-1:findex2-1))^3*y02(K,J,*,I)*df(findex-1:findex2-1))/9.81 - IF (bulktype EQ 3) THEN $ - y2(K,J,I)=2.*TOTAL((2*!pi*freq(findex-1:findex2-1))^3*y02(K,J,*,I) $ - *df(findex-1:findex2-1)*(1-0.5*(y01(K,J,*,I)*!dtor)^2))/9.81 - IF (bulktype EQ 4) THEN $ - y2(k,J,I)=MEAN((2*!pi)^4*freq(findex-1:findex2-1)^5*y02(K,J,*,I))/9.81^2 - IF (bulktype EQ 5) THEN $ - y2(k,J,I)=TOTAL((2*!pi*freq(findex-1:findex2-1))^2*y02(K,J,*,I)*df(findex-1:findex2-1)) - IF (bulktype EQ 6) THEN BEGIN - m1=TOTAL((freq(findex-1:findex2-1))^1*y02(K,J,*,I)*df(findex-1:findex2-1)) - m0=TOTAL(y02(K,J,*,I)*df(findex-1:findex2-1)) - y2(k,J,I)=m0/m1 -; PRINTF,unit1,dates[I].y,dates[I].m,dates[I].d,dates[I].h,m1,y2(k,J,I) - - ENDIF - IF (bulktype EQ 7) THEN BEGIN - m2=TOTAL((freq(findex-1:findex2-1))^(2)*y02(K,J,*,I)*df(findex-1:findex2-1)) - m0=TOTAL(y02(K,J,*,I)*df(findex-1:findex2-1)) - y2(k,J,I)=(m0/m2)^(0.5) -; PRINTF,unit1,dates[I].y,dates[I].m,dates[I].d,dates[I].h,m1,y2(k,J,I) - - ENDIF - ENDFOR - ENDFOR - ENDFOR -; close,unit1 -; FREE_LUN,unit1 - - ENDIF ;(datatype EQ 3) - END - 'sth1m':BEGIN - FOR I=0,nt-1 DO BEGIN - FOR J=0,np-1 DO BEGIN - FOR K=0,nr-1 DO BEGIN - ; y(k,J,I)=SQRT(TOTAL(y0(K,J,*,I)^2*y0w(K,J,*,I)*df(findex-1:findex2-1))/ $ - ; TOTAL(y0w(K,J,*,I)*df(findex-1:findex2-1)) ) - m1temp=abs(1-0.5*(y0(K,J,*,I)*!dtor)^2) - a1temp=cos(y0d(K,J,*,I)*!dtor)*m1temp - b1temp=sin(y0d(K,J,*,I)*!dtor)*m1temp - a1=TOTAL(a1temp*y0w(K,J,*,I)*df(findex-1:findex2-1)) - b1=TOTAL(b1temp*y0w(K,J,*,I)*df(findex-1:findex2-1)) - E=TOTAL(y0w(K,J,*,I)*df(findex-1:findex2-1)) - m1=sqrt(a1^2+b1^2)/E - y(k,J,I)=sqrt(abs(2*(1-m1)))/!dtor - ENDFOR - ENDFOR - ENDFOR - IF (datatype EQ 3) THEN BEGIN - FOR I=0,nt-1 DO BEGIN - FOR J=0,np-1 DO BEGIN - FOR K=0,modspec.nrun-1 DO BEGIN - ; y2(k,J,I)=SQRT(TOTAL(y02(K,J,*,I)^2*y02w(K,J,*,I)*df(findex-1:findex2-1))/ $ - ; TOTAL(y02w(K,J,*,I)*df(findex-1:findex2-1)) ) - m1temp=abs(1-0.5*(y02(K,J,*,I)*!dtor)^2) - a1temp=cos(y02d(K,J,*,I)*!dtor)*m1temp - b1temp=sin(y02d(K,J,*,I)*!dtor)*m1temp - a1=TOTAL(a1temp*y02w(K,J,*,I)*df(findex-1:findex2-1)) - b1=TOTAL(b1temp*y02w(K,J,*,I)*df(findex-1:findex2-1)) - E=TOTAL(y02w(K,J,*,I)*df(findex-1:findex2-1)) - m1=sqrt(a1^2+b1^2)/E - y2(k,J,I)=sqrt(abs(2*(1-m1)))/!dtor - - - ENDFOR - ENDFOR - ENDFOR - ENDIF - END -; - ELSE: BEGIN - yp=FLTARR(nr,np,findex2-findex+1,nt) - yp(*,*,*,*)=data(*,*,plottype,*,0,*) - y=FLTARR(nr,np,nt) - FOR I=0,nt-1 DO BEGIN - FOR J=0,np-1 DO BEGIN - FOR K=0,nr-1 DO BEGIN - fp=MAX(data(K,J,0,*,0,I),Ifmax) - y(K,J,I)=data(K,J,plottype,Ifmax,0,I) - ENDFOR - ENDFOR - ENDFOR - IF (datatype EQ 3) THEN BEGIN - y2=FLTARR(modspec.nrun,np,nt) - FOR I=0,nt-1 DO BEGIN - FOR J=0,np-1 DO BEGIN - FOR K=0,modspec.nrun-1 DO BEGIN - fp=MAX(data2(K,J,0,*,0,I),Ifmax) - y2(K,J,I)=data2(K,J,plottype,Ifmax,0,I) - ENDFOR - ENDFOR - ENDFOR - ENDIF - END - ENDCASE - ENDIF - - - tit=' ' - CASE varname of - 'Ef':BEGIN - ats='at' - ; ats=dictionnaire.at(ilang) - hss='significant wave height' - ; hss=dictionnaire.hs(ilang) - IF (c_cut EQ 0) OR (c_cut EQ 3) OR (c_cut EQ 4) OR (c_cut GE 6) THEN BEGIN - IF (bulktype EQ 0) THEN tit=hss+' (Hs) '+ats+' '+pname - IF (bulktype EQ 1) THEN tit='pseudo-m.s.s. '+ats+' '+pname - IF (bulktype EQ 2) THEN tit='Non-directional surface Stokes drift '+ats+' '+pname - IF (bulktype EQ 3) THEN tit='Surface Stokes drift '+ats+' '+pname - IF (bulktype EQ 4) THEN tit="Phillips' constant "+ats+' '+pname - IF (bulktype EQ 5) THEN tit="Surface velocity variance "+ats+' '+pname - IF (bulktype EQ 6) THEN tit="Mean period Tm01 "+ats+' '+pname - IF (bulktype EQ 0) THEN BEGIN - mmtom='m' - IF (MAX(y) LT 0.5) THEN BEGIN - mmtom='cm' - y=y*100. - IF (datatype EQ 3) THEN y2=y2*100. - IF (MAX(y) LT 3) THEN BEGIN - mmtom='mm' - y=y*10. - IF (datatype EQ 3) THEN y2=y2*10. - ENDIF - ENDIF - ytit='Hs ('+ mmtom+' '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - ENDIF - IF (bulktype EQ 1) THEN ytit='pseudo-m.s.s. (m, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 1) THEN ytit='pseudo-m.s.s. (m, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 2) THEN ytit='Ussnd (m/s, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 3) THEN ytit='Uss (m/s, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 4) THEN ytit='mean alpha ('+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 5) THEN ytit=' (m2/s2, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 6) THEN ytit='Mean period Tm01 (s, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - ENDIF ELSE BEGIN - tit='E(f) at '+pname - ytit='E (m^2/Hz)' - ENDELSE - END - 'Fp':BEGIN - ats='at' - ; ats=dictionnaire.at(ilang) - IF (c_cut EQ 0) OR (c_cut EQ 3) OR (c_cut EQ 4) OR (c_cut EQ 7) THEN BEGIN - IF (bulktype EQ 0) THEN tit='Microseismic bottom pressure variance'+' (m2/s2) '+ats+' '+pname - IF (bulktype EQ 1) THEN tit='pseudo-m.s.s. '+ats+' '+pname - IF (bulktype EQ 0) THEN ytit='Hs (m, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - IF (bulktype EQ 1) THEN ytit='pseudo-m.s.s. (m, '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - ENDIF ELSE BEGIN - tit='Microseismic bottom pressure spectrum at '+pname - ytit='Fp (m^2/s)' - ENDELSE - END - 'Hs':BEGIN - ytit = 'Hs (m)' - tit='Significant wave height at '+pname - END - 'Curr':BEGIN - ytit = 'Current speed (m/s)' - tit='Current at '+pname - END - 'fp':BEGIN - ytit = 'fp (Hz)' - tit='Peak period at '+pname - END - 'f0-1':BEGIN - ytit = 'f0-1 (Hz)' - tit='Mean frequency (f0-1) at '+pname - END - 'f02':BEGIN - ytit = 'f02 (Hz)' - tit='Mean frequency (f02) at '+pname - END - 'U10':BEGIN - ytit = 'U10 (m/s)' - tit='Wind speed at '+pname - END - 'Udir':BEGIN - ytit = 'wind direction (deg)' - tit='Wind direction at '+pname - END - 'Hsband':BEGIN - ytit = 'Hs (m, 0.055 - 0.155 Hz only)' - tit='Significant wave height at '+pname - END - 'psi':ytit = 'Normalised Shields number' - 'ab':BEGIN - ytit = '0.7 * d1/3 (m)' - ypnoz=0.7*ypnoz - END - 'ub':ytit = 'r.m.s. bottom velocity amplitude (m/s)' - 'th1':BEGIN - IF (c_cut EQ 0) OR (c_cut EQ 3) OR (c_cut EQ 4) OR (c_cut GE 7) THEN BEGIN - ytit ='mean direction ('+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' from, degrees)' - ENDIF ELSE BEGIN - ytit = 'theta_mean(fp) (from, degrees)' - ENDELSE - tit='Mean direction at '+pname - IF typ EQ 1 THEN BEGIN - index180=WHERE(yp LT 0, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)+360. - ENDIF - END - 'th1m':BEGIN - IF (c_cut EQ 0) OR (c_cut EQ 3) OR (c_cut EQ 4) OR (c_cut GE 7) THEN BEGIN - ytit ='mean direction ('+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' from, degrees)' - ENDIF ELSE BEGIN - ytit = 'theta_mean(fp) (from, degrees)' - ENDELSE - tit='Mean direction at '+pname - IF typ EQ 1 THEN BEGIN - index180=WHERE(yp LT 0, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)+360. - ENDIF - END - 'th2':BEGIN - ytit = 'Mean direction 2 (from, degrees)' - IF typ EQ 1 THEN BEGIN - index180=WHERE(yp GE 180, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)-180. - index180=WHERE(yp LT 0, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)+180. - ENDIF - END - 'th2m':BEGIN - ytit = 'Mean direction 2 (from, degrees)' - IF typ EQ 1 THEN BEGIN - index180=WHERE(yp GE 180, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)-180. - index180=WHERE(yp LT 0, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)+180. - ENDIF - END - 'thu':ytit = 'theta_u (degrees)' - 'sth1':BEGIN - ats='at' - ; ats=dictionnaire.at(ilang) - IF (c_cut EQ 0) OR (c_cut EQ 3) OR (c_cut EQ 4) OR (c_cut GE 7) THEN BEGIN - tit='Directional spread (sth1m) '+ats+' '+pname - ytit='sth1m (deg., '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - END - END - 'sth1m':BEGIN - IF typ EQ 0 THEN BEGIN - ytit = 'sigma_theta(fp) (degrees)' - tit = 'Directional spread at '+pname - ENDIF ELSE BEGIN - ats='at' - ; ats=dictionnaire.at(ilang) - tit='Directional spread (sth1m) '+ats+' '+pname - ytit='sth1m (deg., '+STRING(FREQ(findex-1),FORMAT='(F5.3)') $ - +'-'+STRING(FREQ(findex2-1),FORMAT='(F5.3)')+' Hz)' - ENDELSE - END - 'sth2':ytit = 'Directional spread 2 (degrees)' - 'sth2m':ytit = 'Directional spread 2 (degrees)' - ELSE: - ENDCASE - - IF typ EQ 1 THEN BEGIN - CASE c_cut OF - 0:BEGIN ;time series of bulk parameter - yp=FLTARR(nr,nt) - yp(*,*)=y(*,c_spec,*) - IF (datatype EQ 3) THEN BEGIN - yp2=FLTARR(modspec.nrun,nt) - yp2(*,*)=y2(*,c_spec,*) - ENDIF - END - 1:BEGIN ;time series - yp=FLTARR(nt) - yp(*)=data(0,c_spec,plottype,findex-1,0,*) - IF (datatype EQ 3) THEN BEGIN - yp2=FLTARR(modspec.nrun,nt) - yp2(*,*)=data2(*,c_spec,plottype,findex-1,0,*) - ENDIF - END - 2:BEGIN ;f-spectrum - x=f(findex-1:findex2-1) - rangex=[min(x),max(x)] - xtit='f (Hz)' - yp=FLTARR(nr,findex2-findex+1) - yp(*,*)=data(*,c_spec,plottype,*,0) - ;time average - IF (smoothing GT 1) THEN BEGIN - nstrue=MIN([indext2-indext+1,smoothing]) - FOR I=0,nstrue-1 DO yp(*)=yp(*)+data(0,c_spec,plottype,*,0,I) - yp(*)=yp(*)/nstrue - ENDIF - IF (datatype EQ 3) THEN BEGIN - yp2=FLTARR(modspec.nrun,findex2-findex+1) - yp2(*,*)=data2(*,c_spec,plottype,*,0) - IF (smoothing GT 1) THEN BEGIN - nstrue=MIN([indext2-indext+1,smoothing]) - FOR I=0,nstrue-1 DO yp2(*,*)=yp2(*,*)+data2(*,c_spec,plottype,*,0,I) - yp2(*,*)=yp2(*,*)/nstrue - ENDIF - ENDIF - rangey=[min(yp),max(yp)] - IF fixrange THEN rangey=[mindepth,maxdepth] - END -; - 3:BEGIN ;mean f-spectrum - x=f(findex-1:findex2-1) - rangex=[min(x),max(x)] - xtit='f (Hz)' - yp=FLTARR(nr,findex2-findex+1) - yp(*,*)=TOTAL(data(*,c_spec,plottype,*,0,*),6)/nt - IF (datatype EQ 3) THEN BEGIN - yp2=FLTARR(modspec.nrun,findex2-findex+1) - yp2(*,*)=TOTAL(data2(*,c_spec,plottype,*,0,*),6)/nt - ENDIF - rangey=[min(yp),max(yp)] - IF fixrange THEN rangey=[mindepth,maxdepth] - END; - 4:BEGIN - kount=nt - I=FINDGEN(NT) - yp=FLTARR(nr,kount) - yp(*)=data(*,c_spec,plottype,0,0,I) - yp=FLTARR(nr,kount) - yp(*,*)=y(*,c_spec,I) - IF (datatype EQ 3) THEN BEGIN ;scatterplot of bulk - yp2=FLTARR(modspec.nrun,kount) - yp2(*,*)=y2(*,c_spec,I) - x=yp - rangex=[min(x),max(x)] - IF fixrange THEN rangex=[mindepth,maxdepth] - xtit='observations' - ENDIF ELSE BEGIN ;f-time plot - yp2=FLTARR(nt,findex2-findex+1) - yp2(*,*)=TRANSPOSE(data(0,c_spec,plottype,*,0,*)) - ytit='frequency (Hz)' - ENDELSE - END - - 5:BEGIN ;frequency-time plot - yp=FLTARR(nt,findex2-findex+1) - yp(*,*)=TRANSPOSE(data(0,c_spec,plottype,*,0,*)) - END -; -;Q-Q plot -; - 6:BEGIN - nav=nbins; - yp=FLTARR(1,nt) - yp(0,*)=y(0,c_spec,*) - indexnoz=WHERE(yp NE 0,kountz) - print,'YP:',size(yp),max(indexnoz),min(indexnoz) - ys=SORT(yp(indexnoz)); - taille=size(ys); - nQ=taille(1)/nav; - Indexz=WHERE(yp EQ 0,kountz) - yQ=REBIN(yp(ys(0:nQ*nav-1)),nav) - yp2=FLTARR(nt) - dirs=FLTARR(nt) - yp2(*)=y(0,c_spec,*) - IF (datatype EQ 3) THEN BEGIN - yp1=FLTARR(modspec.nrun,nt) - yp3=FLTARR(modspec.nrun,nt) - FOR K=0,modspec.nrun-1 DO BEGIN - yp1(K,*)=y2(K,c_spec,*) - yp3(K,indexnoz)=(y2(K,c_spec,indexnoz)-yp(indexnoz))^2 - ENDFOR - yp2=REBIN(yp1(*,ys(0:nQ*nav-1)),modspec.nrun,nav) - yp4=sqrt(REBIN(yp3(*,ys(0:nQ*nav-1)),modspec.nrun,nav)) ; STD dev of error - ENDIF - x=yQ - yp=FLTARR(1,nav); - yp(0,*)=yQ - rangex=[min(x),max(x)] - IF fixrange THEN rangex=[mindepth,maxdepth] - xtit='observations' - END -; -; Binned data plot: should make a separate subroutine !! -; - 8:BEGIN - - yp=FLTARR(nr,nt) - yp(*)=y(*,c_spec,*) - yp2=FLTARR(modspec.nrun,nt) - indexnoz=WHERE(yp NE 0,kountz) - ys=yp(indexnoz); - K=0 ; first model run - x=yp; - - yp2(K,*)=y2(K,c_spec,*) - y=yp2; - - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - IF fixrange THEN rangex=[mindepth,maxdepth] - IF fixrange THEN rangey=[mindepth,maxdepth] - nbin=nbins; - makebin,x,y,rangex,rangey,nbin,nbin,bindata,bindataw, ibin,jbin - xx=rangex(0)+FINDGEN(nbin)*(rangex(1)-rangex(0))/(nbin-1) - yy=rangey(0)+FINDGEN(nbin)*(rangey(1)-rangey(0))/(nbin-1) - fixrangememo=fixrange - mindepthmemo=mindepth - maxdepthmemo=maxdepth - mindepth=0 - maxdepth=1 - fixrange=1 - - NMAX=MAX(bindata) - bindata=bindata/NMAX - IND=WHERE(bindata EQ 0,kount) - IF (kount GT 0) THEN bindata(IND)=2*maxval - ;IND=WHERE(bindata LT maxval,kount) - ;IF (kount GT 0) THEN bindata(IND)=bindata(IND)/nmax - IF outxtit THEN xtit='observations' ELSE xtit='' - IF outxtit THEN ytit='model' ELSE xtit='' - Rescale,1 - POSBOX=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - PLOT,rangex,rangey,XSTYLE=1,YSTYLE=1, $ ;xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3,/NODATA,LINESTYLE=2, $ - YGRIDSTYLE=2,Yticklen=1, XGRIDSTYLE=2,Xticklen=1 , POSITION=POSBOX - IF outcbtit THEN cbtit='Normalized occurence (nmax='+STRING(NMAX,FORMAT='(I6)')+')' $ - ELSE cbtit='' - binplot=bindata - Contorno,binplot,xx,yy,'',xtit,ytit,cbtit,0,0,1 - xm1=FLTARR(nbin) - ym1=xm1 - xm2=xm1 - ym2=ym1 - FOR I=0,nbin-1 DO BEGIN - IND=WHERE(ibin EQ I,kount) - IF (kount GT 0) THEN BEGIN - xm1(I)=TOTAL(x(IND))/kount - ym1(I)=TOTAL(y(IND))/kount - xm2(I)=MEDIAN(x(IND)) - ym2(I)=MEDIAN(y(IND)) - ENDIF ELSE BEGIN - xm1(I)=maxval*1.2 - ym1(I)=maxval*1.2 - xm2(I)=maxval*1.2 - ym2(I)=maxval*1.2 - ENDELSE - ENDFOR - OPLOT,xm1,ym1,THICK=4,LINESTYLE=0,MAX_VALUE=maxval - ;OPLOT,xm2,ym2,THICK=2,LINESTYLE=0,MAX_VALUE=maxval,COLOR=120 - OPLOT,rangex,rangey,THICK=3,LINESTYLE=2 - mindepth=mindepthmemo - maxdepth=maxdepthmemo - fixrange=fixrangememo - RETURN - END - - 9:BEGIN ;mss avg in bin ... JEJE PLOT - varn=STRMID(varname,0,3) - IU10=-1 - IHs=-1 - Imsc=-1 - FOR J=obs2.nvar-1,0,-1 DO BEGIN -; -; Looks for wind and other variables -; - var3=STRMID((*obs2.varnames)[J],0,3) - IF (var3 EQ 'U10') THEN IU10=J - IF (var3 EQ 'msc') THEN Imsc=J - ENDFOR -; - FOR J=obs2.nvar-1,0,-1 DO BEGIN - var2=STRMID((*obs2.varnames)[J],0,2) - IF (var2 EQ 'Hs') THEN IHs=J - ENDFOR - IF (iHS GE 0 AND iU10 GE 0) THEN BEGIN - - yp=FLTARR(nt) - IF (datatype EQ 1) THEN yp(*)=y(0,c_spec,*) ELSE yp(*)=y2(0,c_spec,*) - - - x=FLTARR(nt) - y=FLTARR(nt) - data02=(*obs2.data) - - FOR I=0L,nt-1 DO $ - IF ((*obs2.flags)[indext+I] NE 0) THEN BEGIN - x(I)=data02(0,c_spec,IU10,0,0,I) - y(I)=data02(0,c_spec,IHs,0,0,I) - ENDIF - - indexnoz=WHERE(yp NE 0 AND x LT 45,kountz) - - ys=yp(indexnoz); - - IF fixrange THEN rangex=[mindepth,maxdepth] - IF fixrange THEN rangey=[mindepth,maxdepth] - hsmax=maxdepth; - nbiny=nbins; - nbinx=26 - rangex=[0,25]; [min(x),max(x)] - hsmin=0.0; - rangey=[hsmin,hsmax] - - ys2=FLTARR(kountz); - FOR I=0L,kountz-1 DO BEGIN - ys2(I)=0.85*(1.25-0.25*(0.5/freq(findex2-1))^1.3)*2*(0.000295*x(indexnoz(I)) $ - *MIN([x(indexnoz(I)),14.5])+(y(indexnoz(I))-0.0)*0.0135); - ys2(I)=1*(1.25-0.25*(0.5/freq(findex2-1))^1.3)*(0.00059*x(indexnoz(I)) $ - *MIN([x(indexnoz(I)),14.5])+(y(indexnoz(I))-0.4)*0.027); - ENDFOR - - makebin,x(indexnoz),y(indexnoz),rangex,rangey,nbinx,nbiny,bindata,bindataw, $ - ibin,jbin ,binweight=ys - xx=rangex(0)+FINDGEN(nbinx)*(rangex(1)-rangex(0))/(nbinx-1) - yy=hsmin+FINDGEN(nbiny)*(hsmax-hsmin)/(nbiny-1) - yyy=bindataw(ibin,jbin) - - - var1=sqrt(mean((ys-yyy)^2)) - var2=sqrt(mean((ys2-ys)^2)) - rms1=sqrt(mean(ys^2)) - PRINT,'fcut:',freq(findex2-1),'rel to 0.5:',(1.125-0.0625/freq(findex2-1)) - PRINT,'Variance left:',var1,var2,mean(ys-ys2),100*var1/rms1,100*var2/rms1 - IF outxtit THEN xtit='U10 (m/s)' ELSE xtit='' - IF outytit THEN ytit=ytit ELSE xtit='' - rangey=[min(ys),max(ys)] - Rescale,0 - PLOT,rangex,rangey,XSTYLE=1,YSTYLE=1, $ ;xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3,/NODATA,LINESTYLE=2, $ - YGRIDSTYLE=2,Yticklen=1, XGRIDSTYLE=2,Xticklen=1 , POSITION=POSBOX - IF outcbtit THEN cbtit='Hs (m)' ELSE cbtit='' - c_numlev=Navailcolor-4 - - zmin=min(y) - zmax=max(y) - IF fixrange THEN BEGIN - mindata=mindepth - maxdata=maxdepth - ENDIF ELSE BEGIN - maxdata=MIN([zmax,maxdepth]) - mindata=MAX([zmin,mindepth]) - ENDELSE - IF (mindepth GT zmin) THEN zmin=mindepth - IF (maxdepth LT zmax) THEN zmax=maxdepth - - MakeLevels,mindata,maxdata,zmin,zmax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - image=1+ BYTSCL(yy,min=mindata,max=maxdata,Top=(navailcolor-4)) - - FOR I=0,nbinx-1 DO BEGIN - FOR J=0,nbiny-1 DO BEGIN - ;cindex=MAX(MIN(ROUND((y(J)-zmin)/(zmax-zmin))*255,255),0) - IF (bindata(I,J) GT 0) THEN BEGIN - II=WHERE(IBIN EQ I AND JBIN EQ J,kount) - IF (kount GE 2) THEN BEGIN - err=0.5*STDDEV(ys(II)-bindataw(I,J)) - PLOTS,xx(I),[bindataw(I,J)-err,bindataw(I,J)+err],THICK=2 - err=STDDEV(ys(II)-bindataw(I,J)) - ENDIF - PLOTS,xx(I),bindataw(I,J),THICK=2,PSYM=-4-(J MOD 4),COLOR=image(J),SYMSIZE=2 - ;PLOTS,xx(I),0.02+3.2*0.000295*xx(I)*MIN([xx(I),14.5])+(YY(J)-0.0)*0.0135,THICK=2,PSYM=-4-(J MOD 4),COLOR=image(J),SYMSIZE=2 - ;PLOTS,xx(I),0.00028*xx(I)+(YY(J)-0.0)*0.022,THICK=2,PSYM=-4-(J MOD 4),COLOR=image(J),SYMSIZE=2 - ENDIF - ENDFOR - ENDFOR - if cbar THEN ColorBar,lev,cbtit,zmin,zmax - ENDIF - RETURN - END - - ELSE: BEGIN - Print,'This plot option is not available' - RETURN - END - ENDCASE - ENDIF - - - - - IF typ EQ 0 THEN BEGIN ; For data files with bulk parameters. - ; some of the code here can probably be merged with typ EQ 1 code ... - - yp=FLTARR(nr,nt) - yp(*)=data(*,c_spec,plottype,0,0,*) - FOR K=0,nr-1 DO BEGIN - yp(K,*)=data(K,c_spec,plottype,0,0,*) - ENDFOR - yp2=FLTARR(nt) - dirs=FLTARR(nt) - yp2(*)=data(0,c_spec,plottype,0,0,*) - IF (datatype EQ 3) THEN BEGIN - yp2=FLTARR(modspec.nrun,nt) - FOR K=0,modspec.nrun-1 DO BEGIN - yp2(K,*)=data2(K,c_spec,plottype,0,0,*) - ENDFOR - ENDIF - - - CASE c_cut OF -; -;scatterplot for typ EQ 0 -; - 4:IF (datatype EQ 3) THEN BEGIN - yp=FLTARR(nr,nt) - yp(*)=data(*,c_spec,plottype,0,0,*) - FOR K=0,nr-1 DO BEGIN - yp(K,*)=data(K,c_spec,plottype,0,0,*) - ENDFOR - yp2=FLTARR(nt) - dirs=FLTARR(nt) - yp2(*)=data(0,c_spec,plottype,0,0,*) - yp2=FLTARR(modspec.nrun,nt) - FOR K=0,modspec.nrun-1 DO BEGIN - yp2(K,*)=data2(K,c_spec,plottype,0,0,*) - ENDFOR - x=yp - rangex=[min(x),max(x)] - IF fixrange THEN rangex=[mindepth,maxdepth] - xtit='observations' - ENDIF -; -;Q-Q plot for typ EQ 0 -; - 5:BEGIN - nav=nbins; - yp=FLTARR(nr,nt) - yp(*)=data(*,c_spec,plottype,0,0,*) - indexnoz=WHERE(yp NE 0,kountz) - ys=SORT(yp(indexnoz)); - taille=size(ys); - - nQ=taille(1)/nav; - Indexz=WHERE(yp EQ 0,kountz) - yQ=REBIN(yp(0,ys(0:nQ*nav-1)),nr,nav) - FOR K=0,nr-1 DO BEGIN - yp(K,*)=data(K,c_spec,plottype,0,0,*) - ENDFOR - yp2=FLTARR(nt) - dirs=FLTARR(nt) - yp2(*)=data(0,c_spec,plottype,0,0,*) - ;yp2=0.6*data(0,0,0,0,0,*)/data(0,0,2,0,0,*) - IF (datatype EQ 3) THEN BEGIN - yp1=FLTARR(modspec.nrun,nt) - yp3=FLTARR(modspec.nrun,nt) - FOR K=0,modspec.nrun-1 DO BEGIN - yp1(K,*)=data2(K,c_spec,plottype,0,0,*) - yp3(K,indexnoz)=(data2(K,c_spec,plottype,0,0,indexnoz)-yp(indexnoz))^2 - ENDFOR - yp2=REBIN(yp1(*,ys(0:nQ*nav-1)),modspec.nrun,nav) - yp4=sqrt(REBIN(yp3(*,ys(0:nQ*nav-1)),modspec.nrun,nav)) ; STD dev of error - ENDIF - x=yQ - yp=FLTARR(1,nav); - yp(0,*)=yQ - rangex=[min(x),max(x)] - IF fixrange THEN rangex=[mindepth,maxdepth] - xtit='observations' - END - -; -; Binned data plot for typ EQ 0 -; - 6:BEGIN - yp=FLTARR(nr,nt) - yp(*)=data(*,c_spec,plottype,0,0,*) - yp2=FLTARR(modspec.nrun,nt) - indexnoz=WHERE(yp NE 0,kountz) - ys=yp(indexnoz); - K=0 ; first model run - x=yp; - yp2(K,*)=data2(K,c_spec,plottype,0,0,*) - y=yp2; - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - IF fixrange THEN rangex=[mindepth,maxdepth] - IF fixrange THEN rangey=[mindepth,maxdepth] - nbin=nbins; - makebin,x,y,rangex,rangey,nbin,nbin,bindata,bindataw, ibin,jbin - xx=rangex(0)+FINDGEN(nbin)*(rangex(1)-rangex(0))/(nbin-1) - yy=rangey(0)+FINDGEN(nbin)*(rangey(1)-rangey(0))/(nbin-1) - fixrangememo=fixrange - mindepthmemo=mindepth - maxdepthmemo=maxdepth - mindepth=0 - maxdepth=1 - fixrange=1 - - NMAX=MAX(bindata) - bindata=bindata/NMAX - IND=WHERE(bindata EQ 0,kount) - IF (kount GT 0) THEN bindata(IND)=2*maxval - ;IND=WHERE(bindata LT maxval,kount) - ;IF (kount GT 0) THEN bindata(IND)=bindata(IND)/nmax - IF outxtit THEN xtit='observations' ELSE xtit='' - IF outxtit THEN ytit='model' ELSE xtit='' - Rescale,1 - POSBOX=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - PLOT,rangex,rangey,XSTYLE=1,YSTYLE=1, $ ;xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3,/NODATA,LINESTYLE=2, $ - YGRIDSTYLE=2,Yticklen=1, XGRIDSTYLE=2,Xticklen=1 , POSITION=POSBOX - IF outcbtit THEN cbtit='Normalized occurence (nmax='+STRING(NMAX,FORMAT='(I6)')+')' $ - ELSE cbtit='' - binplot=bindata - Contorno,binplot,xx,yy,'',xtit,ytit,cbtit,0,0,1 - ; IF filltype LE 4 THEN Drawframe,xtit,' ',ytit,' ',FRAME=1 - xm1=FLTARR(nbin) - ym1=xm1 - xm2=xm1 - ym2=ym1 - FOR I=0,nbin-1 DO BEGIN - IND=WHERE(ibin EQ I,kount) - IF (kount GT 0) THEN BEGIN - xm1(I)=TOTAL(x(IND))/kount - ym1(I)=TOTAL(y(IND))/kount - xm2(I)=MEDIAN(x(IND)) - ym2(I)=MEDIAN(y(IND)) - ENDIF ELSE BEGIN - xm1(I)=maxval*1.2 - ym1(I)=maxval*1.2 - xm2(I)=maxval*1.2 - ym2(I)=maxval*1.2 - ENDELSE - ENDFOR - OPLOT,xm1,ym1,THICK=4,LINESTYLE=0,MAX_VALUE=maxval - ;OPLOT,xm2,ym2,THICK=2,LINESTYLE=0,MAX_VALUE=maxval,COLOR=120 - OPLOT,rangex,rangey,THICK=3,LINESTYLE=2 - mindepth=mindepthmemo - maxdepth=maxdepthmemo - fixrange=fixrangememo - RETURN - END - 7:BEGIN ;mss avg in bin ... JEJE PLOT - varn=STRMID(varname,0,3) - IU10=-1 - IHs=-1 - Imsc=-1 - IF datatype NE 1 THEN BEGIN ; model - FOR J=modspec.nvar-1,0,-1 DO BEGIN - var3=STRMID((*modspec.varnames)[J],0,3) - IF (var3 EQ 'U10') THEN IU10=J - IF (var3 EQ 'msc') THEN Imsc=J - ENDFOR -; FOR J=obs.nvar-1,0,-1 DO BEGIN - FOR J=modspec.nvar-1,0,-1 DO BEGIN - var2=STRMID((*modspec.varnames)[J],0,2) - IF (var2 EQ 'Hs') THEN IHs=J - ENDFOR - IF (iHS GE 0 AND iU10 GE 0) THEN BEGIN - yp=FLTARR(nr,nt) - IF Imsc GE 0 THEN BEGIN - ymsc=FLTARR(nt) - data0=(*modspec.data) - FOR I=0L,nt-1 DO $ - IF ((*modspec.flags)[indext+I] NE 0) THEN BEGIN - J=0L+(*om.datem)[indext+I] - ymsc(I)=data0(0,c_spec,Imsc,(*om.fm)[findex-1:findex2-1],0,J) - ENDIF - yp(*)=data0(0,c_spec,plottype,0,0,*); ymsc(*)*1.5 - ENDIF ELSE BEGIN - yp(*)=data0(0,c_spec,plottype,0,0,*) - ENDELSE - - data0=(*modspec.data) - data1=(*obs.data) - x=FLTARR(nt) - y=FLTARR(nt) - FOR I=0L,nt-1 DO $ - IF ((*modspec.flags)[indext+I] NE 0) THEN BEGIN - J=0L+(*om.datem)[indext+I] - ;JO=0L+(*om.dateo)[indext+I] ; index for obs ... - x(I)=data0(0,c_spec,IU10,(*om.fm)[findex-1:findex2-1],0,J) - y(I)=data0(0,c_spec,IHs,(*om.fm)[findex-1:findex2-1],0,J) -; y(I)=data1(0,c_spec,IHs,(*obs.f)[findex-1:findex2-1],0,JO) - ENDIF - ENDIF - ENDIF ELSE BEGIN ; observations - FOR J=obs.nvar-1,0,-1 DO BEGIN - ; FOR J=modspec.nvar-1,0,-1 DO BEGIN - var3=STRMID((*modspec.varnames)[J],0,3) - IF (var3 EQ 'U10') THEN IU10=J - IF (var3 EQ 'msc') THEN Imsc=J - ENDFOR - FOR J=obs.nvar-1,0,-1 DO BEGIN - var2=STRMID((*obs.varnames)[J],0,2) - IF (var2 EQ 'Hs') THEN IHs=J - ENDFOR - - IF (iHS GE 0 AND iU10 GE 0) THEN BEGIN - yp=FLTARR(nt) - yp(*)=data(0,c_spec,plottype,0,0,*) - ENDIF ELSE BEGIN - yp(*)=data(0,c_spec,plottype,0,0,*) - ENDELSE - - data0=(*modspec.data) - x=FLTARR(nt) - y=FLTARR(nt) - FOR I=0L,nt-1 DO $ - IF ((*obs.flags)[indext+I] NE 0) THEN BEGIN - x(I)=data0(0,c_spec,IU10,(*om.fm)[findex-1:findex2-1],0,I) - ; x(I)=data(0,c_spec,IU10,(*obs.f)[findex-1:findex2-1],0,I) - y(I)=data(0,c_spec,IHs,(*obs.f)[findex-1:findex2-1],0,I) - ENDIF - ENDELSE ; end of if test on model / obs - - - - IF (iHS GE 0 AND iU10 GE 0) THEN BEGIN - indexnoz=WHERE(yp NE 0 AND x LT 45,kountz) - ys=yp(indexnoz); - IF fixrange THEN rangex=[mindepth,maxdepth] - IF fixrange THEN rangey=[mindepth,maxdepth] - nbiny=nbins; - nbinx=26 - rangex=[0,25]; [min(x),max(x)] - hsmin=0.0; - hsmax=13 ; - rangey=[hsmin,hsmax] - - ys2=ys; - - makebin,x(indexnoz),y(indexnoz),rangex,rangey,nbinx,nbiny,bindata,bindataw, $ - ibin,jbin ,binweight=ys - xx=rangex(0)+FINDGEN(nbinx)*(rangex(1)-rangex(0))/(nbinx-1) - yy=hsmin+FINDGEN(nbiny)*(hsmax-hsmin)/(nbiny-1) - yyy=bindataw(ibin,jbin) - varl=sqrt(mean((ys-yyy)^2)) - var2=sqrt(mean((ys2-ys)^2)) - rms1=sqrt(mean(ys^2)) - PRINT,'Variance left:',varl,var2,mean(ys-ys2),100*var2/rms1 - IF outxtit THEN xtit='U10 (m/s)' ELSE xtit='' - IF outxtit THEN ytit=varname ELSE xtit='' - rangey=[min(ys),max(ys)] - Rescale,0 - PLOT,rangex,rangey,XSTYLE=1,YSTYLE=1, $ ;xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3,/NODATA,LINESTYLE=2, $ - YGRIDSTYLE=2,Yticklen=1, $ - XGRIDSTYLE=2,Xticklen=1 , $ - POSITION=POSBOX - IF outcbtit THEN cbtit='Hs (m)' ELSE cbtit='' - c_numlev=Navailcolor-4 - - zmin=min(y) - zmax=max(y) - IF fixrange THEN BEGIN - mindata=mindepth - maxdata=maxdepth - ENDIF ELSE BEGIN - maxdata=MIN([zmax,maxdepth]) - mindata=MAX([zmin,mindepth]) - ENDELSE - IF (mindepth GT zmin) THEN zmin=mindepth - IF (maxdepth LT zmax) THEN zmax=maxdepth - - MakeLevels,mindata,maxdata,zmin,zmax - colorind=1+FINDGEN(navailcolor-5+addmini+addmaxi) - image=1+ BYTSCL(yy,min=mindata,max=maxdata,Top=(navailcolor-4)) - - FOR I=0,nbinx-1 DO BEGIN - FOR J=0,nbiny-1 DO BEGIN - ;cindex=MAX(MIN(ROUND((y(J)-zmin)/(zmax-zmin))*255,255),0) - IF (bindata(I,J) GT 0) THEN BEGIN - II=WHERE(IBIN EQ I AND JBIN EQ J,kount) - IF (kount GE 2) THEN BEGIN - err=0.5*STDDEV(ys(II)-bindataw(I,J)) - PLOTS,xx(I),[bindataw(I,J)-err,bindataw(I,J)+err],THICK=2 - err=STDDEV(ys(II)-bindataw(I,J)) - ENDIF - PLOTS,xx(I),bindataw(I,J),THICK=2,PSYM=-4-(J MOD 4),COLOR=image(J),SYMSIZE=2 - ENDIF - ENDFOR - ENDFOR - if cbar THEN ColorBar,lev,cbtit,zmin,zmax - ENDIF - ; ENDIF - RETURN - END - 8:BEGIN ;error map - varn=STRMID(varname,0,3) - Ilat=-1 - Ilon=-1 - names=(*obs.varnames) - FOR J=obs.nvar-1,0,-1 DO BEGIN - var3=STRMID(names(J),0,3) - IF (var3 EQ 'lon') THEN Ilon=J - IF (var3 EQ 'lat') THEN Ilat=J - ENDFOR - IF (ilon GE 0 AND ilat GE 0) THEN BEGIN - yp=FLTARR(nr,nt) - yp(*)=data2(0,c_spec,plottype,0,0,*)-data(0,c_spec,plottype,0,0,*) - - data0=(*modspec.data) - x=FLTARR(nt) - y=FLTARR(nt) - FOR I=0L,nt-1 DO $ - IF ((*modspec.flags)[indext+I] NE 0) THEN BEGIN - J=0L+(*om.datem)[indext+I] - x(I)=data0(0,c_spec,Ilon,(*om.fm)[findex-1:findex2-1],0,J) - y(I)=data0(0,c_spec,Ilat,(*om.fm)[findex-1:findex2-1],0,J) - ENDIF - indexnoz=WHERE(yp NE 0,kountz) - ys=yp(indexnoz); - IF fixrange THEN rangex=[mindepth,maxdepth] - IF fixrange THEN rangey=[mindepth,maxdepth] - nbiny=nbins; - nx=180 - ny=72 - - rangex=[0,360]; [min(x),max(x)] - rangey=[-72,72] - makebin,x(indexnoz),y(indexnoz),rangex,rangey,nx,ny,bindata,bindataw, $ - ibin,jbin ,binweight=ys - IZ=WHERE(bindata EQ 0,kount) - bindataw(IZ)=2*maxval - xx=rangex(0)+FINDGEN(nx)*(rangex(1)-rangex(0))/(nx-1) - yy=min(y)+FINDGEN(ny)*(max(y)-min(y))/(ny-1) - - IF outxtit THEN cbtit='mss bias' ELSE cbtit='' - rlonmax=max(xx) - rlonmin=min(xx) - rlatmax=max(yy) - rlatmin=min(yy) - - nxzmin=0 - nyzmin=0 - nxzmax=nx-1 - nyzmax=ny-1 - dx=(rlonmax-rlonmin)*(40000./((nx-1)*360.))*cos(0.5*(rlatmin+rlatmax)*!dtor) - dy=(rlatmax-rlatmin)*(40000./((ny-1)*360.)) - - dlat=rlatmax-rlatmin - - Rescale,1 - - PLOT,rangex,rangey,XSTYLE=1,YSTYLE=1, $ ;xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3,/NODATA,LINESTYLE=2, $ - YGRIDSTYLE=2,Yticklen=1, $ - XGRIDSTYLE=2,Xticklen=1 , $ - POSITION=POSBOX - Contorno,bindataw,xx,yy,tit,'x (km)','y (km)',cbtit,0,0,0 - IF (filltype LE 4) THEN BEGIN - !P.CLIP=[min(x),min(y),0,max(x),max(y),1] - ad2dmisc - ENDIF - - ENDIF - RETURN - END - 9:BEGIN ;rms error map for typ EQ 0 - varn=STRMID(varname,0,3) - Ilat=-1 - Ilon=-1 - names=(*obs.varnames) - FOR J=obs.nvar-1,0,-1 DO BEGIN - var3=STRMID(names(J),0,3) - IF (var3 EQ 'lon') THEN Ilon=J - IF (var3 EQ 'lat') THEN Ilat=J - ENDFOR - IF (ilon GE 0 AND ilat GE 0) THEN BEGIN - yp=FLTARR(nt) - yp(*)=data2(0,c_spec,plottype,0,0,*)-data(0,c_spec,plottype,0,0,*) - - data0=(*modspec.data) - x=FLTARR(nt) - y=FLTARR(nt) - FOR I=0L,nt-1 DO $ - IF ((*modspec.flags)[indext+I] NE 0) THEN BEGIN - J=0L+(*om.datem)[indext+I] - x(I)=data0(0,c_spec,Ilon,(*om.fm)[findex-1:findex2-1],0,J) - y(I)=data0(0,c_spec,Ilat,(*om.fm)[findex-1:findex2-1],0,J) - ENDIF - indexnoz=WHERE(yp NE 0,kountz) - ys=yp(indexnoz); - IF fixrange THEN rangex=[mindepth,maxdepth] - IF fixrange THEN rangey=[mindepth,maxdepth] - nbiny=nbins; - nx=180 - ny=72 - - rangex=[0,360]; [min(x),max(x)] - rangey=[-72,72] - makebin,x(indexnoz),y(indexnoz),rangex,rangey,nx,ny,bindata,bindataw0, $ - ibin,jbin ,binweight=ys - - ys=FLTARR(kountz) - ys(*)=(data2(0,c_spec,plottype,0,0,indexnoz)- $ - data(0,c_spec,plottype,0,0,indexnoz))^2 - ;-bindataw0(ibin(indexnoz),jbin(indexnoz)) - makebin,x(indexnoz),y(indexnoz),rangex,rangey,nx,ny,bindata,bindataw, $ - ibin,jbin ,binweight=ys - IZ=WHERE(bindata EQ 0,kount) - bindataw=sqrt(bindataw) - bindataw(IZ)=2*maxval - xx=rangex(0)+FINDGEN(nx)*(rangex(1)-rangex(0))/(nx-1) - yy=min(y)+FINDGEN(ny)*(max(y)-min(y))/(ny-1) - - IF outxtit THEN cbtit='RMSE' ELSE cbtit='' - rlonmax=max(xx) - rlonmin=min(xx) - rlatmax=max(yy) - rlatmin=min(yy) - - nxzmin=0 - nyzmin=0 - nxzmax=nx-1 - nyzmax=ny-1 - dx=(rlonmax-rlonmin)*(40000./((nx-1)*360.))*cos(0.5*(rlatmin+rlatmax)*!dtor) - dy=(rlatmax-rlatmin)*(40000./((ny-1)*360.)) - - dlat=rlatmax-rlatmin - - Rescale,1 - - PLOT,rangex,rangey,XSTYLE=1,YSTYLE=1, $ ;xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3,/NODATA,LINESTYLE=2, $ - YGRIDSTYLE=2,Yticklen=1, XGRIDSTYLE=2,Xticklen=1 , POSITION=POSBOX - Contorno,bindataw,xx,yy,tit,'x (km)','y (km)',cbtit,0,0,0 - IF (filltype LE 4) THEN BEGIN - !P.CLIP=[min(x),min(y),0,max(x),max(y),1] - ad2dmisc - ENDIF - - ENDIF - RETURN - END - 10:BEGIN ;diff vs fp - IF (datatype EQ 3) THEN BEGIN - - FOR I=0,nt-1 DO BEGIN - IF (yp(0,I) EQ 0.) OR (yp2(0,I) EQ 0.) THEN yp2(*,I)=0. $ - ELSE yp2(*,I)=(yp2(*,I)-yp(0,I))/yp(0,I) - ENDFOR - yp(*,*)=0. - ENDIF - x=FLTARR(nt) - FOR I=0,nt-1 DO BEGIN - ;print,I,yp2(0,I),yp(0,I),data0(0,((*om.po)[c_spec]),7,0,(*om.dateo)[indext+I]) - ;x(I)=data0(0,(*om.po)[c_spec],7,0,(*om.dateo)[indext+I]) - x(I)=data0(0,(*om.po)[c_spec],2,0,(*om.dateo)[indext+I]) - ENDFOR - rangex=[0.06,0.12] - xtit='fp (Hz)' - ytit='Relative error on '+varname+' at '+pname - END - - 11:BEGIN ;diff vs value - IF (datatype EQ 3) THEN BEGIN - - FOR I=0,nt-1 DO BEGIN - IF (yp(0,I) EQ 0.) OR (yp2(0,I) EQ 0.) THEN yp2(*,I)=0. $ -; ELSE yp2(*,I)=(yp2(*,I)-yp(0,I))/yp(0,I) - ELSE yp2(*,I)=yp2(*,I) - ENDFOR - ENDIF - x=FLTARR(nt) - FOR I=0,nt-1 DO BEGIN - x(I)=data0(0,5,(*om.vo)[plottype],0,0,(*om.dateo)[indext+I]) - ENDFOR - yp(*,*)=0. - rangex=[Min(x),MAX(x)] - xtit='Measured '+varname+' at X6' - ytit='Measured '+varname+' at '+pname - END - - ELSE: - ENDCASE - IF (varname EQ 'th1') THEN BEGIN - index180=WHERE(yp LT 0, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)+360. - ;index180=WHERE(yp GT 180, kount) - ;IF kount GT 0 THEN yp(index180)=4.*maxval - index180=WHERE(yp2 LT 0, kount) - IF kount GT 0 THEN yp2(index180)=yp2(index180)+360. - ENDIF - IF (varname EQ 'th2') THEN BEGIN - index180=WHERE(yp GE 180, kount) - IF kount GT 0 THEN yp(index180)=yp(index180)-180. - index180=WHERE(yp2 LT 0, kount) - IF kount GT 0 THEN yp2(index180)=yp2(index180)+180. - ENDIF - ENDIF - - - - IF varname EQ 'th2' THEN BEGIN - indexpi=WHERE(yp LT 0,kountpi) - IF kountpi NE 0 THEN yp(indexpi)=yp(indexpi)+180. - indexpi=WHERE(yp GE 180,kountpi) - IF kountpi NE 0 THEN yp(indexpi)=yp(indexpi)-180. - ENDIF - IF varname EQ 'th2m' THEN BEGIN - indexpi=WHERE(yp GE 180.,kountpi) - IF kountpi NE 0 THEN yp(indexpi)=yp(indexpi)-180. - indexpi=WHERE(yp LT 0,kountpi) - IF kountpi NE 0 THEN yp(indexpi)=yp(indexpi)+180. - ENDIF - taille=size(yp) - ypnoz=yp - - Indexz=WHERE(yp EQ 0,kountz) - Indexnoz=WHERE(yp NE 0,kountnoz) - wherez=yp*0 - IF (kountnoz GT 0) THEN wherez(Indexnoz)=1 - wherez2=wherez - kountz2=0 - IF (typ EQ 0 AND taille(2) GT 3 AND taille(0) EQ 2) THEN BEGIN - wherez2(*,1:taille(2)-1)=wherez2(*,1:taille(2)-1)+ $ - wherez(*,0:taille(2)-2) - wherez2(*,0:taille(2)-2)=wherez2(*,0:taille(2)-2)+ $ - wherez(*,1:taille(2)-1) - Indexz2=WHERE((wherez2 EQ 1) OR (wherez2 EQ 2),kountz2) - ENDIF - IF kountz GT 0 THEN ypnoz(Indexz)=4.*maxval - rangey=[min(ypnoz),max(yp)] - IF (datatype EQ 3) THEN BEGIN - yp2noz=yp2 - Indexnoz2=WHERE(yp2 EQ 0,kountnoz2) - IF kountnoz2 GT 0 THEN yp2noz(Indexnoz2)=4.*maxval - rangey=[min([min(ypnoz),min(yp2noz)]),max([max(yp),max(yp2)])] - ENDIF - - IF C_cut EQ 2 THEN BEGIN - y=f(findex-1:findex2-1) - cbtit=ytit - ytit='E(f) (m2/Hz)' - ENDIF - IF fixrange THEN rangey=[mindepth,maxdepth] - - - IF (kountnoz EQ 0) THEN PRINT,'All data are zero' ELSE BEGIN - Rescale,0 - nonames=REPLICATE(' ',30) - - IF outtit EQ 0 THEN tit='' - IF outxtit EQ 0 THEN xtit='' - IF outytit EQ 0 THEN ytit='' - - ts_processed = c_cut - IF (typ EQ 0 AND c_cut LT 4) THEN ts_processed = 0 - - IF (NT GT 1) THEN BEGIN -; Plots with orientation "portrait" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - IF axis_orient EQ 0 THEN BEGIN - IF (datatype EQ 3 OR ts_processed NE 4) THEN BEGIN - IF (ts_processed NE 4 AND ts_processed NE 7) THEN BEGIN - IF (N_ELEMENTS(xposi) GT 1) THEN BEGIN - PLOT,x,ypnoz(0,*),/NODATA,XSTYLE=1,YSTYLE=0, $; yticks=cbnticks, $ ;Ytickname=nonames, $ - xminor=xnminor,xticks=xnticks,xtickname=xtnames, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3, $ - YGRIDSTYLE=2,Yticklen=1, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - ENDIF ELSE BEGIN -print,'TEST:',c_cut,ts_processed - PLOT,x,ypnoz(0,*),XSTYLE=1, YSTYLE=0, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangey,THICK=3, POSITION=POSBOX - ENDELSE -; -; Adds model runs for comparison -; - IF (datatype EQ 3) THEN BEGIN - FOR I=0,modspec.nrun-1 DO BEGIN - OPLOT,x,yp2noz(I,*),LINESTYLE=I+1,MAX_VALUE=maxval,THICK=2, $ - PSYM=1+((I+3) MOD 8), $ - COLOR=1+(I+1)*(Navailcolor-4)/modspec.nrun-1 - ENDFOR - ENDIF - - OPLOT,x,ypnoz(0,*),THICK=5,MAX_VALUE=maxval - IF (kountz2 NE 0) THEN OPLOT,x(indexz2),ypnoz(0,indexz2),PSYM=1,MAX_VALUE=maxval,THICK=2 - IF (outx1lab EQ 1) AND (N_ELEMENTS(xposi) GT 1) THEN BEGIN - yposi=xposi*0+bly - XY=CONVERT_COORD(xposi,yposi,/DATA,/TO_NORMAL) - XYOUTS,XY(0,*),yposi-0.020,xnames,ALIGNMENT=0.5,/NORMAL - ENDIF - ENDIF ELSE BEGIN -; Scatter plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - rangep=rangex - if rangey(0) LT rangex(0) THEN rangep(0)=rangey(0) - if rangey(1) GT rangex(1) THEN rangep(1)=rangey(1) - rangex=rangep - rangey=rangep - Rescale,1 - PLOT,rangex,rangex,XSTYLE=1,YSTYLE=1, xticks=cbnticks, yticks=cbnticks, $ - XTITLE=xtit,YTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - xrange=rangex,yrange=rangex,THICK=3, $ - YGRIDSTYLE=2,Yticklen=1, XGRIDSTYLE=2,Xticklen=1, POSITION=POSBOX - FOR I=modspec.nrun-1,0,-1 DO BEGIN - OPLOT,x(Indexnoz),yp2noz(I,Indexnoz),LINESTYLE=I+1,MAX_VALUE=maxval,THICK=2, $ - PSYM=1+((I+3) MOD 8), $ - COLOR=1+(I+1)*(Navailcolor-4)/modspec.nrun-1 - ENDFOR - ENDELSE -; -; this draw the E(f,time) plot -; - ENDIF ELSE BEGIN - yp=f(findex-1:findex2-1) - rangey=[min(yp),max(yp)] - tit='time-frequency diagram at '+pname - PLOT,rangex,rangey,YSTYLE=1,XSTYLE=1,/NODATA,/NOERASE, $ - xminor=xnminor,xticks=xnticks,xtickname=xtnames,xtickv=xntickval, $ - Yticklen=1,YTITLE=ytit,XTITLE=xtit,TITLE=tit, yminor=1, $ - Xticklen=1, $ - yrange=rangey,xrange=rangex, $ - XGRIDSTYLE=2,YGRIDSTYLE=2, $ - POSITION=POSBOX - Contorno,yp2,x,yp,tit,xtit,ytit,cbtit,0,0,1 - fp=FLTARR(nt) - - FOR I=0,nt-1 DO BEGIN - efmax=MAX(yp2(I,*),J) - fp(I) = yp(J) - ENDFOR - - IF (NF GT 2) THEN BEGIN - XFRALL=yp(1:NF-1)/yp(0:NF-2) - IF (ABS(MIN(XFRALL)-MAX(XFRALL)) LT 0.2 ) THEN BEGIN - XFR=MEAN(XFRALL) - - XL = 1./XFR - 1. - XH = XFR - 1. - XL2 = XL^2 - XH2 = XH^2 - NMAX=N_ELEMENTS(yp) - FOR I=0,nt-1 DO BEGIN - efmax=MAX(yp2(I,*),J) - - ILOW = MAX ([ 0 , J-1] ) - ICEN = MAX ([ 0 , J ] ) - IHGH = MIN ([ NMAX-1, J+1 ]) - EL = yp2(I,ILOW) - yp2(I,ICEN) - EH = yp2(I,IHGH) - yp2(I,ICEN) - DENOM = XL*EH - XH*EL - TEMP=DENOM - IF ABS(DENOM) LT 1E-15 THEN DENOM = 1E-15 - IF (TEMP LT 0) THEN DENOM = -1E-15 - IF efmax GT 0 THEN fp(I) = yp(J) * ( 1. + 0.5 * ( XL2*EH - XH2*EL ) $ - / DENOM) ELSE yp(I)=4.*maxval - ENDFOR - ENDIF - ENDIF - - OPLOT,x,fp,THICK=3,MAX_VALUE=maxval - IF (outx1lab EQ 1) AND (N_ELEMENTS(xposi) GT 1) THEN BEGIN - yposi=xposi*0+bly-textdy - XY=CONVERT_COORD(xposi,yposi,/DATA,/TO_NORMAL) - XYOUTS,XY(0,*),yposi-0.0670*!p.charsize,xnames,ALIGNMENT=0.5,/NORMAL - ENDIF - - ENDELSE - -; Plots with orientation "landscape" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ENDIF ELSE BEGIN - IF ts_processed LT 4 THEN BEGIN - xpnoz=-x - indexz=WHERE(ypnoz(0,*) GT MAXVAL,kount) - IF kount GT 0 THEN xpnoz(indexz)=4.*maxval - IF (N_ELEMENTS(xposi) GT 1) THEN BEGIN - PLOT,ypnoz(0,*),xpnoz,/nodata,XSTYLE=1,YSTYLE=0, $ - yminor=xnminor,yticks=xnticks,ytickname=xtnames,ytickv=-xntickval, $ - YTITLE=xtit,XTITLE=ytit,TITLE=tit, xminor=1, $ - xticks=cbnticks, $ - yrange=[-rangex(1),-rangex(0)],xrange=rangey, $ - Xticklen=1,Yticklen=1,XGRIDSTYLE=2,YGRIDSTYLE=2, $ - POSITION=POSBOX - ENDIF ELSE BEGIN - PLOT,ypnoz(0,*),xpnoz,YSTYLE=1,XSTYLE=0, $ - YTITLE=xtit,XTITLE=ytit,TITLE=tit,MAX_VALUE=maxval, $ - yrange=[-rangex(1),-rangex(0)],xrange=rangey,THICK=4,COLOR=252, $ - POSITION=POSBOX - ENDELSE - xpnoz2=-x - indexz=WHERE(yp2 EQ 0,kount) - IF kount GT 0 THEN xpnoz2(indexz)=4.*maxval - IF (datatype EQ 3) THEN BEGIN - FOR I=0,modspec.nrun-1 DO BEGIN - OPLOT,yp2noz(I,*),xpnoz,LINESTYLE=I+1,MAX_VALUE=maxval,THICK=2, $ - PSYM=1+((I+3) MOD 8), COLOR=1+(I+1)*(Navailcolor-4)/modspec.nrun-1 - ENDFOR - ENDIF - OPLOT,ypnoz(0,*),xpnoz,THICK=5,MAX_VALUE=maxval - - ENDIF ELSE BEGIN ; this draw the E(f,time) plot - memo=rangex - xp=f(findex-1:findex2-1) - rangex=[min(xp),max(xp)] - rangey=[-memo(1),-memo(0)] - taille=size(yp) - yy=FLTARR(taille(1)) - yy(*)=x(0,0,*) -; yp2=SMOOTH(ALOG(yp+0.00001)/ALOG(10),3) - PLOT,rangex,rangey,YSTYLE=1,XSTYLE=1,/NODATA,/NOERASE, $ - yminor=xnminor,yticks=xnticks,ytickname=xtnames,ytickv=-xntickval, $ - Yticklen=1,YTITLE=xtit,XTITLE=ytit,TITLE=tit, xminor=1, $ - Xticklen=1, $ - yrange=rangey,xrange=rangex, $ - XGRIDSTYLE=2,YGRIDSTYLE=2, $ - POSITION=POSBOX - IF (filltype EQ 1) THEN $ - Contorno,transpose(REVERSE(yp2,1)),xp,-x,tit,xtit,ytit,cbtit,0,0,1 $ - ELSE Contorno,transpose(yp2),xp,-x,tit,xtit,ytit,cbtit,0,0,1 - - fp=FLTARR(nt) - FOR I=0,nt-1 DO BEGIN - efmax=MAX(yp2(I,*),J) - IF efmax GT 0 THEN fp(I)=xp(J) ELSE xp(I)=4.*maxval - ENDFOR - OPLOT,fp,-x,THICK=3,MAX_VALUE=maxval - - ENDELSE - IF (outx1lab EQ 1) AND (N_ELEMENTS(xposi) GT 1) THEN BEGIN - yposi=xposi*0+blx-textdy*0.1 - XY=CONVERT_COORD(yposi,-xposi,/DATA,/TO_NORMAL) - XYOUTS,yposi-0.0670*!p.charsize,XY(1,*),xnames,ALIGNMENT=0.5,/NORMAL - ENDIF - ENDELSE -; -; Overlays some text on the plot -; - IF (datatype EQ 3) AND (ts_processed LE 4 OR ts_processed EQ 7 OR ts_processed EQ 9) THEN BEGIN - ;comparison of model and data - SI=FLTARR(modspec.nrun) - SI2=FLTARR(modspec.nrun) - BIAS=FLTARR(modspec.nrun) - CORR=FLTARR(modspec.nrun) - MOYC=COMPLEXARR(modspec.nrun+1) - this_var_is_a_direction=(varname EQ 'th1tot') OR (varname EQ 'th1p') OR (varname EQ 'th1m') $ - OR (varname EQ 'Currdir') OR (varname EQ 'Udir') - IF (kountnoz NE 0) THEN BEGIN - IF this_var_is_a_direction THEN BEGIN - ypnoz=complex(cos(ypnoz*!dtor),sin(ypnoz*!dtor)) - yp2=complex(cos(yp2*!dtor),sin(yp2*!dtor)) - ENDIF - MOYC(0)=TOTAL(ypnoz(0,indexnoz),/PRESERVE_TYPE)/kountnoz - - - FOR I=0,modspec.nrun-1 DO BEGIN - IF this_var_is_a_direction THEN $ - SI(I)=TOTAL(ATAN(IMAGINARY(yp2(I,indexnoz)/ypnoz(0,indexnoz)), $ - REAL_PART(yp2(I,indexnoz)/ypnoz(0,indexnoz)))^2) ELSE $ - SI(I)=TOTAL((ypnoz(0,indexnoz)-yp2(I,indexnoz))^2) - - IF rangex(1) EQ 360 THEN BEGIN - SI(I)=0. - FOR II=0,kountnoz-1 DO BEGIN - mod1=ypnoz(0,indexnoz(II)) - obs1=yp2(I,indexnoz(II)) - ENDFOR - ENDIF - MOYC(I+1)=TOTAL(yp2(I,indexnoz),/PRESERVE_TYPE)/kountnoz - MOY=REAL_PART(MOYC) - IF this_var_is_a_direction THEN $ - BIAS(I)=ATAN(IMAGINARY(MOYC(I+1)/MOYC(0)),REAL_PART(MOYC(I+1)/MOYC(0))) $ - ELSE BIAS(I)=(MOY(I+1)-MOY(0)) - - CORR(I)=(TOTAL((yp2(I,indexnoz)-MOYC(I+1)) $ - *(ypnoz(0,indexnoz)-MOYC(0)))) $ - /SQRT(TOTAL(ABS(yp2(I,indexnoz)-MOY(I+1))^2) $ - *TOTAL(ABS(ypnoz(0,indexnoz)-MOY(0))^2)) - IF this_var_is_a_direction THEN $ - SI2(I)=TOTAL(ATAN(IMAGINARY(yp2(I,indexnoz)/ypnoz(0,indexnoz)), $ - REAL_PART(yp2(I,indexnoz)/ypnoz(0,indexnoz))-BIAS(I))^2) ELSE $ - SI2(I)=TOTAL((ypnoz(0,indexnoz)+BIAS(I)-yp2(I,indexnoz))^2) - ENDFOR - true_norm=TOTAL(ypnoz(0,indexnoz)^2) - true_norm2=sqrt(true_norm/kountnoz) - ENDIF ELSE BEGIN - true_norm=1. - FOR I=0,modspec.nrun-1 DO BEGIN - Indexnoz2=WHERE(yp2(I,*) NE 0,kountnoz2) - IF (kountnoz2 GT 0) THEN $ - MOY(I+1)=TOTAL(yp2(I,Indexnoz2))/kountnoz2 ELSE MOY(I+1)=0. - - ENDFOR - ENDELSE - FOR I=0,modspec.nrun-1 DO BEGIN - ;print, true_norm, I, SI(I)/true_norm - PLOTS,textx-0.015,texty+0.007-textdy*(1+I),THICK=2,PSYM=1+((I+3) MOD 8), $ - COLOR=1+(I+1)*(Navailcolor-4)/modspec.nrun-1,/NORMAL - IF this_var_is_a_direction THEN BEGIN - XYOUTS,textx+textdx,texty-textdy*(1+I), $ - STRING(BIAS(I)/!dtor,FORMAT='(F6.2)'), $ - ALIGNMENT=0.0,/NORMAL - XYOUTS,textx,texty-textdy*(1+I), $ - STRING(SQRT(SI(I)/kountnoz)/!dtor,FORMAT='(F6.3)'), $ - ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+2*textdx,texty-textdy*(1+I), $ - STRING(SQRT(SI2(I)/kountnoz)/!dtor,FORMAT='(F6.3)'), $ - ALIGNMENT=0.0,/NORMAL - - ENDIF ELSE BEGIN - XYOUTS,textx,texty-textdy*(1+I), $ - STRING(100.*SQRT(SI(I)/true_norm),FORMAT='(F5.1)'), $ - ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+textdx,texty-textdy*(1+I), $ - STRING(SQRT(SI(I)/kountnoz),FORMAT='(F6.3)'), $ - ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+2.*textdx,texty-textdy*(1+I), $ - STRING(100.*BIAS(I)/true_norm2,FORMAT='(F6.2)'), $ - ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+3.*textdx,texty-textdy*(1+I), $ - STRING(CORR(I),FORMAT='(F7.4)'), $ - ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+4.*textdx,texty-textdy*(1+I), $ - STRING(100.*SQRT(SI2(I)/true_norm),FORMAT='(F5.1)'), $ - ALIGNMENT=0.0,/NORMAL - ENDELSE - ENDFOR - IF this_var_is_a_direction THEN BEGIN - XYOUTS,textx+textdx,texty,'Bias (deg):',ALIGNMENT=0.0,/NORMAL - XYOUTS,textx,texty,'RMSE (deg):',ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+2*textdx,texty,'std. dev. (deg):',ALIGNMENT=0.0,/NORMAL - ENDIF ELSE BEGIN - XYOUTS,textx,texty,'NRMSE (%):',ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+textdx,texty,'RMSE:',ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+2*textdx,texty,'Bias (%):',ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+3*textdx,texty,'Corr.(r):',ALIGNMENT=0.0,/NORMAL - XYOUTS,textx+4*textdx,texty,'S. I.(%):',ALIGNMENT=0.0,/NORMAL - ENDELSE - PRINT,'NRMSE,NB, r, SI:' - FOR I=0,modspec.nrun-1 DO BEGIN - PRINT,'&',100.*SQRT(SI(I)/true_norm), ' ',FORMAT='($,A,F6.1,A)' - ENDFOR - PRINT,'' - FOR I=0,modspec.nrun-1 DO BEGIN - PRINT,'&',100.*BIAS(I)/true_norm2, ' ',FORMAT='($,A,F6.1,A)' - ENDFOR - PRINT,'' - FOR I=0,modspec.nrun-1 DO BEGIN - PRINT,'&',CORR(I),' ',FORMAT='($,A,F9.4,A)' - ENDFOR - PRINT,'' - FOR I=0,modspec.nrun-1 DO BEGIN - PRINT,'&',100.*SQRT(SI2(I)/true_norm), ' ',FORMAT='($,A,F6.1,A)' - ENDFOR - PRINT,'' - PRINT,'MEAN [',STRING(Moy(*),FORMAT='(7F9.4)'),'] ...' - PRINT,'RMSE [',STRING(SQRT(SI(*)/kountnoz),FORMAT='(7F7.3)'),'] ...' - print, 'NP:',kountnoz - print, 'Norm:',true_norm - ENDIF ELSE BEGIN - ;FOR I=0,taille(1)-1 DO PRINT,x(I),yp(*,I) - ENDELSE - - IF (ts_processed GE 2) AND (ts_processed LT 4) THEN BEGIN - zs=' UTC' - assos=STRING(time[tindex-1].m,FORMAT='(I2)')+'/'+ $ - STRING(time[tindex-1].d,FORMAT='(I2)')+'/'+ $ - STRING(time[tindex-1].y,FORMAT='(I4)')+' '+ $ - STRING(time[tindex-1].h,FORMAT='(I2)')+':'+ $ - STRING(time[tindex-1].minu,FORMAT='(I2)') - z=time[tindex-1].zone - IF (z EQ -5) THEN zs=' EST' ELSE $ - IF (z NE 0) THEN BEGIN - IF (z < 0) THEN zs=zs+'-'+STRING(ABS(z),FORMAT='(f3.1)') $ - ELSE zs=zs+'+'+STRING(ABS(z),FORMAT='(f3.1)') - ENDIF - XYOUTS,rangex(0)+0.05*(rangex(1)-rangex(0)), $ - rangey(1)-0.1*(rangey(1)-rangey(0)),assos+zs - ENDIF - ENDIF - ENDELSE - RETURN -END - -;---------------------------------------------------------------------------- -PRO doplotothers -; -; Performs all plots except time series -; -;** 1 ** Display parameters -COMMON AXISFRAME,axis_orient,frametype,outx1lab,outx2lab,outy1lab,outy2lab -COMMON CONTOURPARAM,numlevels,c_repart,lev,maxval,fixrange -COMMON COLORBARPAR,cbnticks,cbexrange,cbtrx,cbtry,cbblx,cbbly, $ - filloutofrange,addmini,addmaxi -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON TITLES, font,outtit,outxtit,outytit,outcbtit,textx,texty,textdx,textdy -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON THREED, Ax3D,Az3D,smoothing -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - -;** 2 ** Display and data variables/parameters -COMMON FREQ, freq,nfband,findex,findex2 -COMMON DIR, nabin,nabint,aindex,THETA -COMMON LANGUAGE, ilang,dictionnaire -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -COMMON TIME, timestep,tindex,tindex2,ntime,dtime,time0,day0,dtindex,nstep, $ - timezone_plot,timezone_string,months,time -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize - -COMMON SPACE, c_gp,c_cut,indexgp,c_x,c_y,c_lon,c_lat -COMMON OVERLAY, addir,adsyms,adbathy,adcoast,psyms,psymsizes,adtr,adtri - -;** 3 ** I/O and data variables -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON COAST, coastxy,coastl,coastnp,GSHHSPoly,GSHHSPoint,GSHHSPoly2,GSHHSPoint2 -COMMON DEPTHSTAT,nbind,bindres,HISTD,MEAND,SDEVD -COMMON DIRSPEC, ds,dsnfband,ndir,kdkdth,dsfreq,dstheta,dsdf,dstime,dsntime,ds_timezone -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON GRIDPar, th1,th2,gfact,gsize1,gsize6 -COMMON RAY3ad, NGPad,SIad,SCad,DEPTHad,HSad,PSIad,BBLDad -COMMON RAYS, raysOK,raystype,raynsteps,rayx,rayy,raya,rayamin,rayamax, $ - rayres,rayfreq,rayGP,raytimestep,rayoffdep,rayflag,raydz,raymindepth -COMMON SOURCE, S0,snabin,sntstep -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON TIMESERIES, modspec,obs,obs2,om,ts_filetype, nbins, bulktype,scatvar -COMMON TRANSECT,Ntrans,Strans,Xtrans,Ytrans,Ztrans,Itrans, $ - COtrans,TransOK,transsym,transline,transthick,Ispectrans, $ - spectransname,ntransgp,transsymsize -COMMON TRIANGLES,ntri,trigp,nzone,c_zone,zcolor,Hlandsea,contourline -COMMON LOCAL2,ymemo,ymemo2 -COMMON WW3, ww3model,ww3date,ww3time,ww3fieldname,ww3scale,ww3miss,ww3unit,ww3lon, $ - ww3lat,ww3matrix,ww3dir,ww3path,spec2D,ww3matrix2,ww3dir2,ncid,ncid2,ncivar0,ncivar -;*******END OF COMMON BLOCKS******************************* - - CASE plotncvar OF - 0 :IF c_cut EQ 1 AND transOK THEN BEGIN - ; Plots the depth along a transect defined in a *.tr file - X=Strans - Y=-Ztrans - rangex=[min(x,imin) -10.,max(x)] - rangey=[max([min(y),-1*maxdepth]),10.] ;max(y)] - Rescale,0 - IF (MAX(Xtrans)-min(Xtrans)) GE ((MAX(Ytrans)-min(Ytrans))) THEN BEGIN - IF Xtrans(Ntrans-1) LT Xtrans(0) THEN BEGIN - PRINT,'REVERSE X AXIS !!' - X=X(Ntrans-1)-X - imin=Ntrans-1-imin - ;Y=Reverse(Y) - ENDIF - ENDIF ELSE BEGIN - IF Ytrans(Ntrans-1) LT Ytrans(0) THEN BEGIN - PRINT,'REVERSE Y AXIS !!' - X=X(Ntrans-1)-X - ;Y=Reverse(Y) - ENDIF - ENDELSE - PLOT,X,Y,XSTYLE=1,YSTYLE=1,MAX_VALUE=maxval,/YNOZERO, $ - YTITLE='Depth (m)',XRANGE=rangex, $ - XTITLE='Distance along transect (km)',YRANGE=rangey, $ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - XX=FLTARR(Ntrans+3) - YY=FLTARR(Ntrans+3) - XX(0:Ntrans-1)=X - YY(0:Ntrans-1)=Y - XX(Ntrans)=rangex(1) - XX(Ntrans+1:Ntrans+2)=rangex(0) - YY(Ntrans:Ntrans+1)=rangey(0) - YY(Ntrans+2)=Y(0) - POLYFILL,XX,YY,/LINE_FILL,ORIENTATION=120,NOCLIP=0, $ - CLIP=[rangex(0),rangey(0),rangex(1),rangey(1)] - - ;XYOUTS,X(Ispectrans(0)),alignment=0.5, $ - ; rangey(1)-0.2*(rangey(1)-rangey(0)),spectransname(0) - ;XYOUTS,X(Ispectrans(ntransgp-1)),alignment=0.5, $ - ; rangey(1)-0.2*(rangey(1)-rangey(0)),spectransname(ntransgp-1) - ;FOR I=1,ntransgp-1 DO $ - ;XYOUTS,X(Ispectrans(I)),rangey(1)-0.1*(rangey(1)-rangey(0)),spectransname(I) - rangex0=rangex - IF (MAX(Xtrans)-min(Xtrans)) GE ((MAX(Ytrans)-min(Ytrans))) THEN BEGIN - rangex=rangex+Xtrans(imin) - ; Drawframe,'Distance along transect (km)', $ - ; 'Longitude (W)','Bottom elevation (m)',' ',FRAME=7, - ENDIF ELSE BEGIN - rangex=rangex+Ytrans(imin) - Drawframe,'Distance along transect (km)', $ - 'Latitude (N)','Bottom elevation (m)',' ',FRAME=8 - ENDELSE - posi=CONVERT_COORD(X(Ispectrans),REPLICATE(rangey(1),ntransgp),/DATA,/TO_NORMAL) - Y(Ispectrans(1))=0. - FOR I=0,ntransgp-1 DO BEGIN - OPLOT,[X(Ispectrans(I))],[Y(Ispectrans(I))],PSYM=6 - XYOUTS,X(Ispectrans(I))+0.04*(1 $;+2*(I MOD 2) - )*(rangex(1)-rangex(0)),ALIGNMENT=0.5, $ - Y(Ispectrans(I))-0.02*(1-2*(I MOD 2))*(rangey(1)-rangey(0)),spectransname(I) - ;PLOT,[posi(0,I),posi(0,I)],[0,1],LINESTYLE=3,/NORMAL, $ - ; XSTYLE=4,YSTYLE=4,/NOERASE,XRANGE=[0,1], $ - ; POSITION=[0,bly*winy/mwiny,1,try*winy/mwiny] - ENDFOR - xp=rangex0(0)+FINDGEN(850)*(rangex0(1)-rangex0(0))/849. - wavel=33 - waveh=4. - taille=SIZE(xp) - ywave=FLTARR(taille(1)) - meanw=1*!pi/SQRT(3)-0.5 - FOR I=0,taille(1)-1 DO BEGIN - I2=I-(wavel-1)*(I/(wavel-1)) - ywave(I)=meanw-2.*SQRT(1.-(FLOAT(I2-wavel/2)/FLOAT(wavel/2))^2) - ENDFOR - OPLOT,xp,ywave - - ENDIF ELSE BEGIN - x=(findgen(nxzmax-nxzmin+1)+nxzmin)*dx - y=(findgen(nyzmax-nyzmin+1)+nyzmin)*dy - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - Rescale,1 - IF ((filltype LE 2) OR (filltype EQ 7)) $ - AND ((RaysOK MOD 2) EQ 1) THEN BEGIN - stfr=string(rayfreq,format='(f6.4)') - tit='Rays of '+stfr+' Hz waves' - cbtit='Depth (m)' - ENDIF ELSE BEGIN - tit='Bottom topography' - cbtit=dictionnaire.dpt(ilang)+' (m)' ; au dessus du zero des cartes)' - ENDELSE - IF datastatus(3) THEN BEGIN -;AAA=stddev(gd(nxzmin:nxzmax,nyzmin:nyzmax)) -; print,'STDDEV:',AAA, AAA/mean(gd(nxzmin:nxzmax,nyzmin:nyzmax)) - table=gd(nxzmin:nxzmax,nyzmin:nyzmax) - Contorno,table,x,y,tit,'x (km)','y (km)',cbtit,0,1,0 - -;slope=0. -;shore=0.1 -;ns=0 -;FOR J=1,nyzmax-nyzmin-2 DO BEGIN -; ;LAND=WHERE(table(*,J) < shore,kount) -; LAND=WHERE(table(*,J) > shore,kount) -; IF (kount GT 0) THEN BEGIN -; shift=0 -; I0=LAND(0) -; ;I0=LAND(kount-1) -; shift=2 -; slope=slope+0.001*sqrt(((table(I0-2+shift,J)-table(I0-1+shift,J))/dx)^2+((table(I0,J+1)-table(I0,J))/dy)^2) -; ns=ns+1 -; ENDIF -;ENDFOR -;meanslope=slope/ns -;print,'Mean slope:',meanslope - - ENDIF ELSE PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - - IF (filltype LE 4) THEN BEGIN - ;!P.CLIP=[min(x),min(y),0,max(x),max(y),1] - ad2dmisc - Drawframe,Drawframe,FRAME=1+MAPLONLAT - ENDIF - - ENDELSE - -; -; Plots bathymetry from gmsh file -; - 1 :BEGIN - x=(findgen(nxzmax-nxzmin+1)+nxzmin)*dx - y=(findgen(nyzmax-nyzmin+1)+nyzmin)*dy - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - Rescale,1 - IF ((filltype LE 2) OR (filltype EQ 7)) $ - AND ((RaysOK MOD 2) EQ 1) THEN BEGIN - stfr=string(rayfreq,format='(f6.4)') - tit='Rays of '+stfr+' Hz waves' - cbtit='Depth (m)' - ENDIF ELSE BEGIN - tit='Bottom topography' - cbtit='Depth (m)' - ;cbtit=dictionnaire.dpt(ilang)+' (m)' ; au dessus du zero des cartes)' - cbtit='Depth (m)' ; au dessus du zero des cartes)' - ENDELSE - IF (N_ELEMENTS(gridmat) GT 0) THEN BEGIN - Z=gridmat(7,*) - X=gridmat(0,*) - Y=gridmat(1,*) - IF (MAX(Z) GT MIN(Z)) THEN BEGIN - tri=TRANSPOSE(TRIGP(1:ntri,1:3)-1) - IF (filltype EQ 0 OR FILLTYPE EQ 3) THEN BEGIN - TRIANGULATE,X,Y,tri - ;Contorno,Z,X,Y,tit,'x (km)','y (km)',cbtit,1,0,1,tri=tri - Contorno,Z,X,Y,tit,'x (km)','y (km)',cbtit,1,1,1,tri=tri - ENDIF ELSE BEGIN - nnx=nxzmax-nxzmin+1 - nny=nyzmax-nyzmin+1 - IF (LONG(NNX)*LONG(NNY) LT 80000000L) THEN BEGIN - arr=trigrid(X,Y,z,tri,[dx,dy],[rangex(0),rangey(0),rangex(1),rangey(1)]) - x=(findgen(nnx)+nxzmin)*dx - y=(findgen(nny)+nyzmin)*dy - Contorno,arr,x,y,tit,'x (km)','y (km)',cbtit,0,1,0 - ENDIF ELSE BEGIN - PRINT,'Plot not performed because interpolation on too large array:',nnx,nny - PRINT,'Please change resolution in *.log file' - ENDELSE - ENDELSE - IF (filltype LE 4) THEN BEGIN - ad2dmisc - IF (MAPFLAG EQ 0) THEN Drawframe,FRAME=1+MAPLONLAT - ENDIF - ENDIF ELSE PRINT,'This array is constant' - ENDIF ; N_ELEMENTS(gridmat) - END -; -; Plots WWATCH gridded output -; - 2 :BEGIN -; -; Shifts indices for global grids to move longitudes -; - nnx=nxzmax-nxzmin+1 - nny=nyzmax-nyzmin+1 - taille=size(ww3matrix) - nlat=taille(0) - IF (nlat GT 1) THEN BEGIN - nshift=0; - ww3matrixshift=SHIFT(ww3matrix,nshift,0); - nxzmaxshift=nxzmax+nshift*dx - nxzminshift=nxzmin+nshift*dx - nnx=nxzmaxshift-nxzminshift+1 - ENDIF - x=(findgen(nnx)+nxzmin)*dx - y=(findgen(nny)+nyzmin)*dy - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - Rescale,1 - - tit=ww3model+' '+ww3date+' '+ww3time - cbtit=ww3fieldname;"Vitesse d'agitation sur le fond" -; -; -; - IF (nlat GT 1 ) THEN BEGIN ; This is for structured grids - IF (STRPOS(cbtit,'W/m2') NE -1) THEN BEGIN - flux=0. - - I=WHERE(ww3matrix EQ -2.*maxval,KOUNT) - IF (KOUNT GT 0) THEN ww3matrix(I)=0. - FOR J=nyzmin,nyzmax DO BEGIN - flux=flux+TOTAL(ww3matrix(nxzmin:nxzmax,J))*cos(ww3lat(J)*!dtor) - ENDFOR - flux=flux*(ww3lat(2)-ww3lat(1))*(ww3lon(2)-ww3lon(1))*(!dtor*4E7/(2*!pi))^2 - print,'FLUX =',flux,' W' - - ENDIF - IF datastatus(20) THEN BEGIN - table=ww3matrixshift(nxzmin:nxzmax,nyzmin:nyzmax) - IF ((STRPOS(cbtit,'Hs') NE -1 OR STRPOS(cbtit,'hs') NE -1 )AND fixrange EQ 0) THEN BEGIN - clev=[0, 0.05, 0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, $ - 2.25 ,2.5, 2.75, 3, 3.25, 3.5, 3.75, 4. ,4.5 ,5., 5.5, 6 ,7, $ - 8 , 9, 10, 11, 12, 13 , 14, 15, 40] - IF (fixrange) THEN clev=clev*maxdepth/15. - coli=[1, 3, 5, 8, 9, 15, 20, 21, 26, 30, $ - 35, 39, 40, 45, 52, 57, 61, 66, 67, 79, 89, 98, 99 , 134, $ - 149, 150, 182, 183, 215, 216, 251, 252] - Contorno,table,x,y,tit,'x (km)','y (km)',cbtit,0,0,0,clev=clev,coli=coli - ENDIF ELSE BEGIN - table(0,0)=-1. - Contorno,table,x,y,tit,'x (km)','y (km)',cbtit,0,0,0 - ENDELSE - ENDIF ELSE PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - IF (addir EQ 0) and (n_elements(ww3dir) NE 0) THEN BEGIN - dirplot=ww3dir -; In case of polar projection: rotation ... - IF (MAPLONLAT EQ 2) THEN dirplot=dirplot-(ww3lon+45); - - xvect=-sin(dirplot(nxzmin:nxzmax,nyzmin:nyzmax)*!dtor) - yvect=-cos(dirplot(nxzmin:nxzmax,nyzmin:nyzmax)*!dtor) - xx=transpose(1.+FLTARR(nny))##x - yy=transpose(y)##(1.+FLTARR(nnx)) - missing=FLTARR(nnx,nny) - Index=WHERE(abs(ww3dir(nxzmin:nxzmax,nyzmin:nyzmax)) GT maxval,kount) - IF kount GT 0 THEN missing(Index)=1 - IF (smoothing GT 1) THEN BEGIN - FOR I=0,nnx-1 DO BEGIN - FOR J=0,nny-1 DO BEGIN - IF (I MOD smoothing) +(J MOD smoothing) NE 0 $ - THEN missing(i,j)=1. - ENDFOR - ENDFOR - ENDIF - VECT,reform(xvect,LONG(nnx)*LONG(nny)),reform(yvect,LONG(nnx)*LONG(nny)), $ - reform(xx,LONG(nnx)*LONG(nny)),reform(yy,LONG(nnx)*LONG(nny)), $ - reform(missing,LONG(nnx)*LONG(nny)),rangex,rangey - ENDIF - ENDIF ELSE BEGIN ; this is for unstructured grids - XGP=FLTARR(nngp) - YGP=FLTARR(nngp) - array2=ww3matrix - array2=array2; ^2*0.001*0.0015 - XGP(0:nngp-1)=gridmat(0,0:nngp-1) - YGP(0:nngp-1)=gridmat(1,0:nngp-1) - IF (STRPOS(cbtit,'Hs') NE -1 AND STRPOS(cbtit,'HsIG') EQ -1 AND fixrange EQ 0) THEN BEGIN - clev=[0, 0.05, 0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, $ - 2, 2.25 ,2.5, 2.75, 3, 3.25, 3.5, 3.75, 4. ,4.5 ,5., 5.5, 6 ,7, $ - 8 , 9, 10, 11, 12, 13 , 14, 15, 40] - IF (fixrange) THEN clev=clev*maxdepth/15. - coli=[1, 3, 5, 8, 9, 15, 20, 21, 26, $ - 30, 35, 39, 40, 45, 52, 57, 61, 66, 67, 79, 89, 98, 99 , 134, $ - 149, 150, 182, 183, 215, 216, 251, 252] - tri=TRANSPOSE(TRIGP(1:ntri,1:3)-1) - IF (filltype EQ 0 OR FILLTYPE EQ 3) THEN $ - Contorno,array2,XGP,YGP,tit,'x (km)','y (km)',cbtit,1,0,1,clev=clev,coli=coli,tri=tri $ - ELSE BEGIN - ENDELSE - ENDIF ELSE BEGIN - tri=TRANSPOSE(TRIGP(1:ntri,1:3))-1L - ;X=XGP - ;Y=YGP - ;Z=array2 - ;SAVE,X,Y,Z,TRI,rangex,rangeY,dx,dy,filename='TRIANGULATION_MARSEILLE.sav', $ - ; DESCRIPTION="Example of grid that fails in CONTOUR with TRIANGULATION keyword" - IF (filltype EQ 0 OR FILLTYPE EQ 3) THEN BEGIN - TRIANGULATE,XGP,YGP,tri - Contorno,array2,XGP,YGP,tit,'x (km)','y (km)',cbtit,1,0,1,tri=tri - ENDIF ELSE BEGIN - arr=trigrid(XGP,YGP,array2,tri,[dx,dy],[rangex(0),rangey(0),rangex(1),rangey(1)], $ - MAX_VALUE=maxval) - x=(findgen(nnx)+nxzmin)*dx - y=(findgen(nny)+nyzmin)*dy - Contorno,arr,x,y,tit,'x (km)','y (km)',cbtit,0,0,0 - ENDELSE - ENDELSE - - - IF (addir EQ 0 AND MAPFLAG EQ 0) and (n_elements(ww3dir) NE 0) THEN BEGIN - TRIANGULATE,xgp,ygp,tr,b - Index=WHERE(ww3matrix GT maxval,kount) - IF (kount GT 1) THEN ww3dir(Index)=1./0 - dircos=TRIGRID(xgp,ygp,cos(ww3dir*!dtor),tr, $ - [dx,dy],[MIN(X), MIN(Y), MAX(X), MAX(Y)],XOUT=X,YOUT=Y) - dirsin=TRIGRID(xgp,ygp,sin(ww3dir*!dtor),tr, $ - [dx,dy],[MIN(X), MIN(Y), MAX(X), MAX(Y)],XOUT=X,YOUT=Y) - xvect=-dirsin - yvect=-dircos - - xx=transpose(1.+FLTARR(nny))##x - yy=transpose(y)##(1.+FLTARR(nnx)) - missing=FLTARR(nnx,nny) - IF (smoothing GT 1) THEN BEGIN - FOR I=0,nnx-1 DO BEGIN - FOR J=0,nny-1 DO BEGIN - IF (I MOD smoothing) +(J MOD smoothing) NE 0 $ - THEN missing(i,j)=1. - ENDFOR - ENDFOR - ENDIF - VECT,reform(xvect,LONG(nnx)*LONG(nny)),reform(yvect,LONG(nnx)*LONG(nny)), $ - reform(xx,LONG(nnx)*LONG(nny)),reform(yy,LONG(nnx)*LONG(nny)), $ - reform(missing,LONG(nnx)*LONG(nny)),rangex,rangey - ENDIF - - - - ENDELSE - - IF (filltype LE 4) THEN BEGIN - ;!P.CLIP=[min(x),min(y),0,max(x),max(y),1] - ad2dmisc - IF (MAPFLAG EQ 0) THEN Drawframe,FRAME=2-ABS(MAPLONLAT-1) - ENDIF - - END - 3:BEGIN - nnx=nxzmax-nxzmin+1 - nny=nyzmax-nyzmin+1 - x=(findgen(nnx)+nxzmin)*dx - y=(findgen(nny)+nyzmin)*dy - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - Rescale,1 - tit=ww3model+' '+ww3date+' '+ww3time - cbtit='diff. '+ww3fieldname - taille=size(ww3matrix) - nlat=taille(2) - IF (nlat GT 1) THEN BEGIN - IF datastatus(21) THEN BEGIN - table=ww3matrix(nxzmin:nxzmax,nyzmin:nyzmax)-ww3matrix2(nxzmin:nxzmax,nyzmin:nyzmax) - Contorno,table,x,y,tit,'x (km)','y (km)',cbtit,0,0,0 - ENDIF ELSE PLOT,[x(0)],[y(0)],xstyle=5,ystyle=5,/NODATA, $ - XRANGE=rangex,YRANGE=rangey, /NOERASE,$ - POSITION=[blx*winx/mwinx,bly*winy/mwiny,trx*winx/mwinx,try*winy/mwiny] - - IF (addir EQ 0) and (n_elements(ww3dir) NE 0) THEN BEGIN - xvect=-sin(ww3dir(nxzmin:nxzmax,nyzmin:nyzmax)*!dtor) - yvect=-cos(ww3dir(nxzmin:nxzmax,nyzmin:nyzmax)*!dtor) - xx=transpose(1.+FLTARR(nny))##x - yy=transpose(y)##(1.+FLTARR(nnx)) - missing=FLTARR(nnx,nny) - Index=WHERE(ww3dir(nxzmin:nxzmax,nyzmin:nyzmax) GT maxval,kount) - IF kount GT 0 THEN missing(Index)=1 - IF (smoothing GT 1) THEN BEGIN - FOR I=0,nnx-1 DO BEGIN - FOR J=0,nny-1 DO BEGIN - IF (I MOD smoothing) +(J MOD smoothing) NE 0 $ - THEN missing(i,j)=1. - ENDFOR - ENDFOR - ENDIF - VECT,reform(xvect,LONG(nnx)*LONG(nny)),reform(yvect,LONG(nnx)*LONG(nny)), $ - reform(xx,LONG(nnx)*LONG(nny)),reform(yy,LONG(nnx)*LONG(nny)), $ - reform(missing,LONG(nnx)*LONG(nny)),rangex,rangey - ENDIF - ENDIF ELSE BEGIN - XGP=FLTARR(nngp) - YGP=FLTARR(nngp) - array2=ww3matrix-ww3matrix2 - XGP(0:nngp-1)=gridmat(0,0:nngp-1) - YGP(0:nngp-1)=gridmat(1,0:nngp-1) - Contorno,array2,XGP,YGP,tit,'x (km)','y (km)',cbtit,1,0,1 - ENDELSE - - IF (filltype LE 4) THEN BEGIN - ;!P.CLIP=[min(x),min(y),0,max(x),max(y),1] - ad2dmisc - IF (MAPFLAG EQ 0) THEN Drawframe,FRAME=1+MAPLONLAT - ENDIF - - END - ENDCASE - RETURN -END - - -;---------------------------------------------------------------------------- -pro gfunct,X,A,f,pder - bx=EXP(A[3]*X) - p1=A[0]*X^2+A[1]*X+A[2] - F=p1*bx+A[4] - IF N_PARAMS() GE 4 THEN $ - pder=[[X^2*bx],[X*bx],[bx],[x*p1*bx],[replicate(1.0, N_ELEMENTS(X))]] - RETURN -END -;---------------------------------------------------------------------------- -PRO LINEPLOT,X,Y,xtit,ytit,tit,SYMOP,LOGFLAG - - rangex=[min(x),max(x)] - rangey=[min(y),max(y)] - Rescale,0 - SYMARR=[-1,4,5,6,8,8,8,-7,2] - XUSYM=FLTARR(9,5) - YUSYM=FLTARR(9,5) - XUSYM(4,*)=[-1,1,0.,-1,1] - YUSYM(4,*)=[1,1,-1,1,1] - XUSYM(5,*)=[-1,1,-1,1,-1] - YUSYM(5,*)=[1,1,-1,-1,1] - XUSYM(6,*)=[-1,1,1,-1,-1] - YUSYM(6,*)=[1,-1,1,-1,1] - XUSYM(8,*)=[-1,1,1,-1,-1] - YUSYM(8,*)=[1,-1,1,-1,1] - PLOT,X,Y(*,0),YRANGE=rangey,XRANGE=rangex, $ - title=title,YLOG=LOGFLAG,XTITLE=xtit,YTITLE=ytit,/NODATA - taille=size(y) - print,taille - IF SYMOP THEN BEGIN - FOR I=0,taille(2)-1 DO BEGIN - USERSYM,XUSYM(I,*),YUSYM(I,*) - OPLOT,X,Y(*,I),PSYM=SYMARR(I),SYMSIZE=0.6 - ENDFOR - ENDIF ELSE BEGIN - SARR=['A','B','C','D','E','F','G','H','I'] - SYMARR=[-3,3,3,3,3,3,3,-3,3] - FOR I=0,taille(2)-1 DO BEGIN - OPLOT,X,Y(*,I),PSYM=SYMARR(I) - XYOUTS,X,Y(*,I),REPLICATE(SARR(I),taille(1)),ALIGNMENT=0.5 - ENDFOR - ENDELSE -END -;---------------------------------------------------------------------------- -PRO UPDATE_COORDINATES,lonmin,lonmax,latmin,latmax,widgetaction -COMMON BATHY, gd,nx,ny,dx,dy,sx,sy,rlonmax,rlonmin,rlatmin,rlatmax -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON FILES, filestatus,datastatus,paths,filters,filenames,raypath -COMMON GRID, gridmat,nngp,ngpused,zonestart,zoneend,truegp,gpused,gpnotused -COMMON SPECIALS,nspecgp,specmat,specname,c_spec,ispec1,ispec2 -COMMON WIDGETS, Wtoprow,Wright,Wdraw,Wdraw_value_update,Wsimple -COMMON ZOOM, nxzmax,nyzmax,nxzmin,nyzmin,maxdepth,mindepth - - inbox=1 - IF (datastatus(2) EQ 1) THEN BEGIN - IF (lonmin LT rlonmin) THEN inbox = 0 - IF (latmin LT rlatmin) THEN inbox = 0 - IF (lonmax GT rlonmax) THEN inbox = 0 - IF (latmax GT rlatmax) THEN inbox = 0 - ENDIF - IF (rlonmin EQ 0 and rlatmax EQ 0) THEN inbox = 0 - IF (datastatus(2) EQ 0 OR inbox EQ 0) THEN BEGIN - nx=4001 - ny=4001 - rlonmin=lonmin - rlonmax=lonmax - rlatmin=latmin - rlatmax=latmax - dlon=rlonmax-rlonmin - dlat=rlatmax-rlatmin - LX=dlon*cos(0.5*(rlatmax+rlatmin)*!pi/180.)*4E7/360. - LY=dlat*4E7/360. - - sx=LX/(nx-1) - sy=LY/(ny-1) - dx=sx/1000. - dy=sy/1000. - PRINT,'Defining coordinate system :',nx,ny,dx,dy - PRINT,'Defining coordinate system :',rlonmin,rlonmax,rlatmin,rlatmax - nxzmin=0L - nyzmin=0L - nxzmax=nx-1 - nyzmax=ny-1 - rangex=[0,dx*FLOAT(nx-1)] - rangey=[0,dy*FLOAT(ny-1)] - datastatus(2)=1 - MAPLONLAT=1 - IF widgetaction THEN WIDGET_CONTROL, Wdraw, SENSITIVE=1 - ENDIF -END - -;-------------- determine les dimensions du graphique ------------------- -PRO Rescale,flag ;appele par Doplot -;** 1 ** Display parameters -COMMON CURRENT, datatype,plottype,line,column,c_numlev,output,plotncvar,normvec -COMMON DRAWING, Navailcolor,colorind,rangex,rangey,xtoy,filltype,logplot -COMMON DRAWSIZE,winx,winy,mwinx,mwiny,blx,bly,trx,try -COMMON FLAGS, eqscale,cbar,clickflag,subwin -COMMON POSTSCRIPT, filep,pspath,prcoul,psor,pstype, $ - pwinx,pwiny,papierx,papiery,xoffset,yoffset, $ - facpolice,fontrescale,basefontsize,pssizex,pssizey,psfont -COMMON MAP, MAPFLAG, MAPPROJ, MAPLONGCENTER, MAPLATCENTER, MAPCONTINENT, $ - MAPCOUNTRIES, MAPLONLAT -;*******END OF COMMON BLOCKS******************************* - - - IF output EQ 1 THEN BEGIN -!p.thick = 2 -!x.thick = 2 -!y.thick = 2 -!z.thick = 2 - winx=mwinx - winy=mwiny -; Conditions sur la taille de la fenetre: -; pssizex < or = pwinx with pssizex=fx*mwinx -; pssizey < or = pwiny with pssizey=fx*ff*mwiny -; The ratio ff between the two factors is determined by: -; (in the case EQSCALE=1): -; pssizex*(trx-blx)/(pssizey*(try-bly)) -; = (rangex(1)-rangex(0))/(rangey(1)-rangey(0)) -; - - IF psor EQ 0 THEN BEGIN ;portrait - pssizex=pwinx - pssizey=pwiny - IF flag EQ 1 AND MAPFLAG EQ 0 THEN BEGIN ;portrait and equal scaling - f=MIN([FLOAT(pssizex)*(trx-blx)/(rangex(1)-rangex(0)), $ - FLOAT(pssizey)*(try-bly)/(rangey(1)-rangey(0))]) - ;print,'factors',f,FLOAT(pssizex)*(trx-blx)/(rangex(1)-rangex(0)), $ - ; FLOAT(pssizey)*(try-bly)/(rangey(1)-rangey(0)) - ;f is the min of the maximum ratio of - ;poststcript distance and data distance for both axes - ;then we apply the same f ratio to both axes: - winx=f*FLOAT(mwinx)*(rangex(1)-rangex(0))/ $ - ((trx-blx)*pssizex) ; horizontal size of plot output - winy=f*FLOAT(mwiny)*(rangey(1)-rangey(0))/ $ - ((try-bly)*pssizey) ; vertical size of plot output - ;print,'winx',winx,mwinx,winy,mwiny - ;print,'plots',pssizex*FLOAT(winx)*(trx-blx)/(rangex(1)-rangex(0))/FLOAT(mwinx), $ - ;pssizey*FLOAT(winy)*(try-bly)/(rangey(1)-rangey(0))/FLOAT(mwiny) - POSI=[blx*FLOAT(winx)/FLOAT(mwinx),bly*FLOAT(winy)/FLOAT(mwiny), $ - trx*FLOAT(winx)/FLOAT(mwinx),try*FLOAT(winy)/FLOAT(mwiny)] - ;print,POSI - ;print,POSI*pssizex - ;print,POSI*pssizey - ;print,'ranges',rangex,rangey - ENDIF ELSE BEGIN ;portrait without equal scaling - winx=mwinx - winy=mwiny - ENDELSE - ENDIF ELSE BEGIN - pssizex=pwiny - pssizey=pwinx - IF flag EQ 1 THEN BEGIN ; landscape and equal scaling - f=MIN([FLOAT(pssizex)*(trx-blx)/(rangex(1)-rangex(0)), $ - FLOAT(pssizey)*(try-bly)/(rangey(1)-rangey(0))]) - IF pstype THEN BEGIN ; case of encapsulated postscript - pssizex=f*(rangex(1)-rangex(0))/(trx-blx) - pssizey=f*(rangey(1)-rangey(0))/(try-bly) - ENDIF - ;f is the min of the maximum ratio of - ;poststcript distance and data distance for both axes - ;then we apply the same f ratio to both axes: - winx=f*mwinx*(rangex(1)-rangex(0))/ $ - ((trx-blx)*pssizex) ; horizontal size of plot output - winy=f*mwiny*(rangey(1)-rangey(0))/ $ - ((try-bly)*pssizey) ; vertical size of plot output - ENDIF ELSE BEGIN ;landscape without equal scaling - winx=mwinx - winy=mwiny - ENDELSE - ENDELSE - - IF output EQ 1 THEN BEGIN - IF psfont EQ 0 THEN DEVICE,/HELVETICA ELSE DEVICE,/TIMES - PRINT,'PSfont:',psfont - ENDIF - IF !P.FONT EQ 1 THEN !P.FONT=0 - !p.charsize=1.5*MIN([pssizex,pssizey])*facpolice/20.0 - - ; adapte la taille de la police a la - ; dimension du graphique - PRINT,'Dimensions de la zone imprimee:',pssizex,pssizey - IF fontrescale THEN BEGIN - !p.charsize=1.5*MIN([pssizex,pssizey])*facpolice/20.0 - PRINT,'Taille reelle de la police (Max(' $ - +strcompress(string(pssizex))+',' $ - +strcompress(string(pssizey))+')*' $ - +strcompress(string(facpolice))+'/20.0):',!p.charsize*basefontsize - ENDIF ELSE BEGIN - !p.charsize=facpolice - PRINT,'Taille reelle de la police :',!p.charsize*basefontsize - ENDELSE - DEVICE,/ISOLATIN1 - IF psor EQ 1 THEN BEGIN ;ouverture fichier postcript couleur - print,'pssizex',pssizex,pssizey - DEVICE,/COLOR, XSIZE=pssizex, YSIZE=pssizey, BITS_PER_PIXEL=8, $ - FONT_SIZE=basefontsize, XOFFSET=xoffset, YOFFSET=(papiery-yoffset), $ - /LANDSCAPE,ENCAPSULATED=pstype, filename=filep - ENDIF ELSE BEGIN - DEVICE,/COLOR, XSIZE=pssizex, YSIZE=pssizey,BITS_PER_PIXEL=8, $ - FONT_SIZE=basefontsize, XOFFSET=xoffset, YOFFSET=yoffset-1., /PORTRAIT, $ - ENCAPSULATED=pstype,filename=filep - ENDELSE - ENDIF ELSE BEGIN -; calculate x and y size for screen display -; Conditions sur la taille de la fenetre: -; winx < ou = mwinx avec winx=f* -; winy < ou = mwiny avec winy=f* -; le rapport ff entre les deux facteurs est determine par la condition: -; (dans le cas ou EQSCALE=1): -; winx*(trx-blx)/(winy*(try-bly)) -; = (rangex(1)-rangex(0))/(rangey(1)-rangey(0)) - - IF flag EQ 1 AND MAPFLAG EQ 0 THEN BEGIN - f=MIN([FLOAT(mwinx)*(trx-blx)/(rangex(1)-rangex(0)), $ - FLOAT(mwiny)*(try-bly)/(rangey(1)-rangey(0))]) - ;f is the maximum number of pixels per data unit - - winx=f*(rangex(1)-rangex(0))/(trx-blx) ; horizontal size of plot output - winy=f*(rangey(1)-rangey(0))/(try-bly) ; vertical size of plot output - ENDIF ELSE BEGIN ;no equal scaling required - winx=(mwinx) ; horizontal size of plot output - winy=(mwiny) ; vertical size of plot output - ENDELSE - ENDELSE - xtoy=1./(FLOAT(winx)/FLOAT(winy)*(rangey(1)-rangey(0))/(rangex(1)-rangex(0))) -END - -;********************************************************************** -PRO LOCATE,itype,ihem,itrans,lat,lon,i,j -;ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - -; attention -;parametres du locate -;ihem=1 ;Pole NORD -;itype=1 ;resolution 12.5km -;itrans=1 ;i,j==>lat,lon ;LOCATE,itype,ihem,itrans,lat,lon,ix,iy - ;sous IDL rajouter 1 a ix et iy avant appel au locate -;itrans=2 ;lat,lon ==>i,j ;LOCATE,itype,ihem,itrans,lat,lon,ix,iy - ;sous IDL enlever 1 a ix et iy apres appel au locate -;;;;; - - - -;ATTENTION cette routine est traduite du fortran. -;les indice i et j commencent a 1 et non pas a zero -; (Attention a PV-Wave il faut enlever 1 a I et J dans le sens lat lon vers I,J -; (Attention a PV-Wave il faut ajouter 1 a I et J dans le sens I,J vers lat lon -; -; LOCATE - This routine transforms I,J coordinates of an SSM/I grid cell -; to latitude and longitude coordinates. This program provides -; the inverse functions as well. LOCATE interfaces to the revised -; forms of the subroutines, MAPXY and MAPLL. -; -; User-defined Parameters: -; -; itype : Integer supplied by the user to describe one of the three -; grid cell dimensions (12.5 km, 25.0 km, or 50.0 km). -; -; ihem : Integer supplied by the user to describe one of the two -; polar regions (1=North , 2=South) -; -; itrans : Integer supplied by the user to describe the type of -; transformation LOCATE will perform (1=I,J-to-Lat,Lon; -; 2=Lat,Lon-to-I,J) -; -; i,j : Integers supplied by the user when itrans = 1. These -; integers describe the position of a cell in an SSM/I grid. -; -; lat,lon : Reals supplied by the user when itrans = 2. These -; integers describe the latitude and longitude in an SSM/I -; grid which LOCATE will transform to an I,J grid cell position. -; Note: All latitudes and longitudes must be entered as -; positive numbers! -; -; Internal: -; -; x,y : Distance in kilometers from the origin of the grid -; (ie., pole). -; -; alat, -; alon : Computed latitude and longitude returned from MAPXY. -; -; SGN : Sign of the latitude (positive = north latitude, -; negative = south latitude) -; -; delta : Meridian offset for the SSM/I grids (0 degrees for -; the South Polar grids; 45 degrees for the North Polar -; grids. -; -; kk : Integer variable used for reorientation of the grid. The -; grid is 'flipped' in the Y direction for transformations. -; -; SLAT : Standard latitude for the SSM/I grids is 70 degrees. -; -; numy : Number of lines in an SSM/I grid. This attribute varies -; for each of the six grids. -; -; cell : Size of the SSM/I grid ( 12.5 km, 25.0 km, 50.0 km) -; -; xydist : Distance from the origin of the grid in the cartesian plane. -; The x-y coordinates for the edge of the lower left pixel -; is (3850.0, 5350.0) for the northern grids and -; (3950.0, 3950.0) for the southern grids. -; -; RE : Radius of the earth in kilometers. -; -; E : Eccentricity of the Hughes ellipsoid -; -; E2 : Eccentricity squared -; -; PI : Pi -; Written by V.J.Troisi - January, 1990 -;ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -numy=INTARR(2,3) -cell=FLTARR(3) -xydist=FLTARR(2,2) -numy(0,0)=896 -numy(1,0)=664 -numy(0,1)=448 -numy(1,1)=332 -numy(0,2)=224 -numy(1,2)=166 -cell(0)=12.5 -cell(1)=25. -cell(2)=50. -xydist(0,0)=3850. -xydist(1,0)=5350. -xydist(0,1)=3950. -xydist(1,1)=3950. -; -SLAT = 70. -RE = 6378.273 -E2 = .006693883 -PI = 3.141592654 -E = SQRT(E2) -; -; grid cell size. -; -; the grid cell dimension: itype -; 1 - 12.5 Km' -; 2 - 25.0 Km' -; 3 - 50.0 Km' -; -; -; the hemisphere of interest: ihem -; 1 - North' -; 2 - South' -; -; Define the sign and meridian offset (delta) for the SSM/I grids. -; -IF (ihem EQ 1) THEN BEGIN -SGN = 1.0 -delta = 45. -ENDIF ELSE BEGIN -SGN = -1.0 -delta = 0.0 -ENDELSE -; -; translation type : itrans -; 0 - Exit' -; 1 - Convert I,J to Latitude, Longitude' -; 2 - Convert Latitude, Longitude to I,J' -; -; Start translation -; -; Because of PV-WAVE indexing starts with 0: -ihem=ihem-1 -itype=itype-1 -IF itrans EQ 0 THEN GOTO, sortie -IF itrans EQ 1 THEN GOTO, ijintoll -IF itrans EQ 2 THEN GOTO, llintoij -; -; Convert I,J pairs to x and y distances from origin. The grid will be -; -; 'flipped' in the 'Y' direction. -; -ijintoll: x=((i-1)*cell(itype))-(xydist(0,ihem)-cell(itype)/2.) -kk=numy(ihem,itype)-(j-1) -y=((kk-1)*cell(itype))-(xydist(1,ihem)-cell(itype)/2.) -; -; Transform x and y distances to latitude and longitude -; -MAPXY,x,y,alat,alon,SLAT,SGN,E,RE -; -; Transform radians to degrees. -; -alon=alon*180./PI -lat=alat*180./PI -alon=alon-delta -; -; Convert longitude to positive degrees -; -lon=alon -IF alon LE 0.0 THEN lon=alon+360. -IF alon GE 360.0 THEN lon=alon-360. -; -GOTO, sortie -; -; llintoij transforms lat,lon en i,j -; -llintoij: alat=abs(lat)*PI/180. -alon=(lon+delta)*PI/180. - -; -; Transform latitude and longitude to x and y distances from origin -; -MAPLL,x,y,alat,alon,SLAT,SGN,E,RE -; -; Convert x and y distances from origin to I,J pair (ii,jj) -; - - -i=FIX(((x+xydist(0,ihem)-cell(itype)/2.)/cell(itype))+.5)+1 -j=FIX(((y+xydist(1,ihem)-cell(itype)/2.)/cell(itype))+.5)+1 - - -; -; Flip grid orientation in the 'Y' direction -; -j=numy(ihem,itype)-(j-1) - -; -sortie: ihem=ihem+1 -itype=itype+1 -RETURN -END -;***************************************************************************** -PRO MAPLL,X,Y,AALAT,AALONG,SGN -;***************************************************************************** -; -; DESCRIPTION: -; -; This subroutine converts from geodetic latitude and longitude to Polar * -; Stereographic (X,Y) coordinates for the polar regions. The equations * -; are from Snyder, J. P., 1982, Map Projections Used by the U.S. * -; Geological Survey, Geological Survey Bulletin 1532, U.S. Government * -; Printing Office. See JPL Technical Memorandum 3349-85-101 for further * -; details. -; -; ; -; ARGUMENTS: -; -; Variable Type I/O Description -; * -; ALAT REAL*4 I Geodetic Latitude (degrees, +90 to -90) * -; ALONG REAL*4 I Geodetic Longitude (degrees, 0 to 360) * -; X REAL*4 O Polar Stereographic X Coordinate (km) * -; Y REAL*4 O Polar Stereographic Y Coordinate (km) * -; * -; * -; Written by C. S. Morris - April 29, 1985 * -; Revised by C. S. Morris - December 11, 1985 * -; -; Revised by V. J. Troisi - January 1990 -; SGN - provides hemisphere dependency (+/- 1) -;***************************************************************************** -; DEFINITION OF CONSTANTS: * -; * -; Conversion constant from degrees to radians = 57.29577951. * -COMMON MAPPOLE, XPOLE, YPOLE, SLAT, RE, E2, E - -CDR=57.29577951 -E2=E*E -PI=3.141592654 -;***************************************************************************** -; Compute X and Y in grid coordinates. - - ALAT = AALAT / CDR - ALONG = (AALONG+45) / CDR - -IF ABS(ALAT) LT PI/2. THEN GOTO, T - X=0.0 - Y=0.0 - GOTO, ret -T: T=TAN(PI/4.-ALAT/2.)/((1.-E*SIN(ALAT))/(1.+E*SIN(ALAT)))^(E/2.) -IF ABS(90.-SLAT) LT 1.E-5 THEN BEGIN -RHO=2.*RE*T/((1.+E)^(1.+E)*(1.-E)^(1.-E))^(1/2.) - -ENDIF ELSE BEGIN -SL=SLAT*PI/180. -TC=TAN(PI/4.-SL/2.)/((1.-E*SIN(SL))/(1.+E*SIN(SL)))^(E/2.) -MC=COS(SL)/SQRT(1.0-E2*(SIN(SL)^2)) -RHO=RE*MC*T/TC -ENDELSE -Y=-RHO*SGN*COS(SGN*ALONG) -X= RHO*SGN*SIN(SGN*ALONG) - -ret: RETURN -END -;***************************************************************************** -PRO MAPXY,XI,YI,ALAT,ALONG,SGN -;***************************************************************************** -; * -; * -; DESCRIPTION: * -; * -; This subroutine converts from Polar Stereographic (X,Y) coordinates * -; to geodetic latitude and longitude for the polar regions. The equations * -; are from Snyder, J. P., 1982, Map Projections Used by the U.S. * -; Geological Survey, Geological Survey Bulletin 1532, U.S. Government * -; Printing Office. See JPL Technical Memorandum 3349-85-101 for further * -; details. * -; * -; * -; ARGUMENTS: * -; * -; Variable Type I/O Description * -; * -; X REAL*4 I Polar Stereographic X Coordinate (km) * -; Y REAL*4 I Polar Stereographic Y Coordinate (km) * -; ALAT REAL*4 O Geodetic Latitude (degrees, +90 to -90) * -; ALONG REAL*4 O Geodetic Longitude (degrees, 0 to 360) * -; * -; * -; Written by C. S. Morris - April 29, 1985 * -; Revised by C. S. Morris - December 11, 1985 * -; * -; Revised by V. J. Troisi - January 1990 -; SGN - provide hemisphere dependency (+/- 1) -; -;***************************************************************************** -; * -; DEFINITION OF CONSTANTS: * -; * -; Conversion constant from degrees to radians = 57.29577951. * -COMMON MAPPOLE, XPOLE, YPOLE, SLAT, RE, E2, E - -X=XI-XPOLE -Y=YI-YPOLE -CDR=57.29577951 -E2=E*E -PI=3.141592654 -; * -;***************************************************************************** -SL = SLAT*PI/180. -E200: RHO=SQRT(X^2+Y^2) -IF RHO GT 0.1 THEN GOTO, E250 -ALAT=90.*SGN -ALONG=0.0 -GOTO, E999 -E250: CM=COS(SL)/SQRT(1.0-E2*(SIN(SL)^2)) -T=TAN((PI/4.0)-(SL/(2.0)))/((1.0-E*SIN(SL))/(1.0+E*SIN(SL)))^(E/2.0) -IF ABS(SLAT-90.) LT 1.E-5 THEN BEGIN -T=RHO*SQRT((1.+E)^(1.+E)*(1.-E)^(1.-E))/2./RE -ENDIF ELSE BEGIN -T=RHO*T/(RE*CM) -ENDELSE -CHI=(PI/2.0)-2.0*ATAN(T) -ALAT=CHI+((E2/2.0)+(5.0*E2^2.0/24.0)+(E2^3.0/12.0))*SIN(2*CHI) -ALAT=ALAT+((7.0*E2^2.0/48.0)+(29.0*E2^3/240.0))*SIN(4.0*CHI)+(7.0*E2^3.0/120.0)*SIN(6.0*CHI) -AALAT=SGN*ALAT -ALONG=ATAN(SGN*X,-SGN*Y) -AALONG=SGN*ALONG - - ALAT = AALAT * CDR - ALONG = AALONG/CDR -45 - -E999: RETURN -END - - - - diff --git a/model/aux/idl_twist/visu.pro b/model/aux/idl_twist/visu.pro deleted file mode 100755 index d9dab2325..000000000 --- a/model/aux/idl_twist/visu.pro +++ /dev/null @@ -1,14 +0,0 @@ -.compile initmain.pro -.compile rt_visumain.pro -.compile read_timeseries.pro -.compile gridbuild.pro -.compile bathytool.pro -.compile editspecials.pro -.compile maketransect.pro -.compile raytracer.pro -.compile parametros.pro -.compile palette.pro -.compile xloadpalette.pro -.compile mapping.pro -CLOSE,/ALL -rt_visumain diff --git a/model/aux/idl_twist/xloadpalette.pro b/model/aux/idl_twist/xloadpalette.pro deleted file mode 100755 index 6ae89a04b..000000000 --- a/model/aux/idl_twist/xloadpalette.pro +++ /dev/null @@ -1,628 +0,0 @@ -; $Id: xloadct.pro,v 1.25 1998/08/20 15:04:17 alan Exp $ -; -; Copyright (c) 1991-1998, Research Systems, Inc. All rights reserved. -; Unauthorized reproduction prohibited. - -PRO XLCT_PSAVE ;Save/Restore our plotting state. -; Swaps our state with the current state each time its called. - -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot, siz, w_height, show_win, $ - updt_callback, updt_cb_data - -tmp = { xlct_psave, win: !d.window, x: !x.s, y: !y.s , xtype: !x.type, $ - ytype: !y.type, clip: !p.clip } - -wset, psave.win -!x.type = psave.xtype -!y.type = psave.ytype -!x.s = psave.x -!y.s = psave.y -!p.clip = psave.clip -psave = tmp -end - -pro xlct_alert_caller -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot, siz, w_height, show_win, $ - updt_callback, p_updt_cb_data - - ErrorStatus = 0 - CATCH, ErrorStatus - if (ErrorStatus NE 0) then begin - CATCH, /CANCEL - v = DIALOG_MESSAGE(['Unexpected error in XLOADCT:', $ - '!ERR_STRING = ' + !ERR_STRING], $ - /ERROR) - return - endif - if (STRLEN(updt_callback) gt 0) then begin - if (PTR_VALID(p_updt_cb_data)) then begin - CALL_PROCEDURE, updt_callback, DATA=*(p_updt_cb_data) - endif else begin - CALL_PROCEDURE, updt_callback - endelse - endif -end - - -; Redraw the ramp image. -PRO xlct_show -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot, siz, w_height, show_win, $ - updt_callback, p_updt_cb_data - - cur_win = !D.WINDOW - WSET, show_win - TV, BYTE((FLOAT(ncolors)*FINDGEN(siz)/FLOAT(siz-1)) # $ - REPLICATE(1, w_height)) + BYTE(cbot) - - WSET, cur_win - - ; Let the caller of XLOADCT know that the color table was modified - xlct_alert_caller -END - -PRO xlct_draw_cps, i, c -COMMON colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot - -tc = color -if n_elements(c) gt 0 then begin - tc = c - if c ne 0 then color = c - endif - -if i[0] eq -1 then j = indgen(n_elements(cps)) else j = i - -plots, cps[j], tfun[j], /noclip, color = tc -plots, cps[j], tfun[j], /noclip, psym=6, color = tc -end - -PRO xlct_transfer, UPDATE=update -COMMON colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot - -l = lonarr(ncolors) ;Subscripts -m = n_elements(cps) -for i=0, m-2 do begin - n = cps[i+1]-cps[i] ;Interval - b = (tfun[i+1]-tfun[i])/float(n) - l[cps[i]] = findgen(n) * b + (tfun[i] + cbot) - endfor -l[ncolors-1] = tfun[m-1] ;Last point -if use_values then begin - r_curr[cbot] = (r = l[r_orig]) - g_curr[cbot] = (g = l[g_orig]) - b_curr[cbot] = (b = l[b_orig]) -endif else begin - r_curr[cbot] = (r = r_orig[l]) - g_curr[cbot] = (g = g_orig[l]) - b_curr[cbot] = (b = b_orig[l]) -endelse - -tvlct, r,g,b, cbot -if (keyword_set( update )) then $ - xlct_show -end - -PRO xloadpalette_event, event -COMMON colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot, siz, w_height, show_win, $ - updt_callback, p_updt_cb_data - - -IF event.id eq state.draw THEN BEGIN ;** PROCESS DRAWABLE EVENTS ** - if event.press ne 0 then begin ;Pressed button? - dmin = 1.0e8 ;Find closest control pnt - xlct_psave ;Remove old - p = convert_coord(event.x, event.y, /TO_DATA, /DEVICE) - xlct_psave ;Restore old - x = fix(p[0]) - y = fix(p[1]) - for i=0, n_elements(cps)-1 do begin - d = (p[0]-cps[i])^2 + (p[1]-tfun[i])^2 ; dist ^ 2 - if d lt dmin then begin - dmin = d - pnt = i - endif - endfor - return - endif - if event.release ne 0 then begin ;Released button? - pnt = -1 - xlct_transfer, /update - return - endif - if pnt lt 0 then return ;Don't care here... - - xlct_psave ;Remove old - ; For visuals with static colormaps, erase plot before drawing new - if ((COLORMAP_APPLICABLE(redrawRequired) GT 0) and $ - (redrawRequired GT 0)) then begin - ERASE, color=0 - endif - p = convert_coord(event.x, event.y, /TO_DATA, /DEVICE) ;Coord of mouse - n = ncolors -1 ;Into range.... - m = n_elements(cps)-1 - x = fix(p[0]) > 0 < n - if pnt eq 0 then x = 0 else $ ;1st & last are fixed - if pnt eq m then x = n else $ - x = x > (cps[pnt-1] + 1) < (cps[pnt+1]-1) ;Others must be between - - if pnt eq 0 then xlct_draw_cps, [0, 1],0 $ ;Erase old segment - else if pnt eq m then xlct_draw_cps, [m-1, m],0 $ - else xlct_draw_cps, [pnt-1, pnt, pnt+1],0 - cps[pnt] = x - tfun[pnt] = fix(p[1]) > 0 < n - xlct_transfer - - b = r_curr * .3 + g_curr * .586 + b_curr * .114 ;Ntsc colors - c = max(abs(b-b[cbot]), j) ; *** J is color index furthest from 0 - - if pnt eq 0 then xlct_draw_cps, [0, 1], j $ - else if pnt eq m then xlct_draw_cps, [m-1, m], j $ - else xlct_draw_cps, [pnt-1, pnt, pnt+1], j - - xlct_psave ;Remove old - return - ENDIF - -WIDGET_CONTROL, event.id, GET_UVALUE = eventval - -abstop = NCOLORS -1 - -if event.id eq state.name_list then begin - ;PRINT,event.index,silent,filename,ncolors,cbot - LOADPALETTE, silent=silent, event.index, FILE=filename, NCOLORS=ncolors, $ - BOTTOM=cbot - PRINT,'DONE' - goto, set_gamma - ENDIF - -CASE eventval OF - "TOP": BEGIN - WIDGET_CONTROL, top, GET_VALUE = vtop - if lock ne 0 then begin - vbot = (vtop - lock) > 0 < 100 - widget_control, bot, SET_VALUE=vbot - endif - GOTO, set_gamma - END - - "BOTTOM": BEGIN - WIDGET_CONTROL, bot, GET_value = vbot - if lock ne 0 then begin - vtop = (vbot + lock) > 0 < 100 - widget_control, top, SET_VALUE=vtop - ENDIF - set_gamma: - if use_values then nc = 256 else nc = ncolors - s = (nc-1)/100. - x0 = vbot * s - x1 = vtop * s - if x0 ne x1 then s = (nc-1.0)/(x1 - x0) else s = 1.0 - int = -s * x0 - if gamma eq 1.0 then s = round(findgen(nc) * s + int > 0.0) $ - else s = ((findgen(nc) * (s/nc) + (int/nc) > 0.0) ^ gamma) * nc - if chop ne 0 then begin - too_high = where(s ge nc, n) - if n gt 0 then s[too_high] = 0L - endif - if use_values then begin - s = s < 255L - l = lindgen(ncolors) + cbot - r_curr[cbot] = (r = s[r_orig[l]]) - g_curr[cbot] = (g = s[g_orig[l]]) - b_curr[cbot] = (b = s[b_orig[l]]) - endif else begin - s = s + cbot - r_curr[cbot] = (r = r_orig[s]) - g_curr[cbot] = (g = g_orig[s]) - b_curr[cbot] = (b = b_orig[s]) - endelse - tvlct, r,g,b, cbot - xlct_show - ENDCASE - - "GAMMA": BEGIN - WIDGET_CONTROL, g_slider, GET_VALUE = gamma - gamma = 10^((gamma/50.) - 1) - WIDGET_CONTROL, g_lbl, SET_VALUE = $ - STRING(gamma, format='(f6.3)') - goto, set_gamma - ENDCASE - - "GANG" : IF event.value eq 0 then lock = 0 else lock = vtop - vbot - - "CHOP" : BEGIN - chop = event.value - goto, set_gamma ;And redraw - ENDCASE - - "VALUES": BEGIN - use_values = event.value - ENDCASE - - "HELP" : XDisplayFile, FILEPATH("xloadct.txt", subdir=['help', 'widget']), $ - TITLE = "Xloadct Help", $ - GROUP = event.top, $ - WIDTH = 55, $ - HEIGHT = 16 - - "RESTORE" : BEGIN ;Restore the original tables - r_curr = (r_orig = r0) - g_curr = (g_orig = g0) - b_curr = (b_orig = b0) - tvlct, r_curr, g_curr, b_curr - xlct_show - ENDCASE - - "OVERWRITE" : BEGIN ;overwrite original tables - r0 = (r_orig = r_curr) - g0 = (g_orig = g_curr) - b0 = (b_orig = b_curr) - reset_all: - WIDGET_CONTROL, top, SET_VALUE = 100 - WIDGET_CONTROL, bot, SET_VALUE = 0 - WIDGET_CONTROL, g_slider, SET_VALUE = 50 - vbot = 0 - vtop = 100 - gamma = 1.0 - GOTO, set_gamma - ENDCASE - - "REVERSE" : BEGIN ;Reverse the table - l = lindgen(ncolors) + cbot - r_orig[cbot] = reverse(r_orig[l]) - g_orig[cbot] = reverse(g_orig[l]) - b_orig[cbot] = reverse(b_orig[l]) - goto, set_gamma ;And redraw - ENDCASE - - "DONE": BEGIN - WIDGET_CONTROL, event.top, /DESTROY - r0 = 0 & g0 = 0 & b0 = 0 ;Free common - if PTR_VALID(p_updt_cb_data) then PTR_FREE, p_updt_cb_data - ENDCASE - "SAVE": BEGIN - file=DIALOG_PICKFILE(/READ, FILTER = '*.ct') - IF file NE '' THEN BEGIN - get_lun, lun2 - OPENW,lun2,file - PRINTF,lun2,CONGRID(r_curr,256),CONGRID(g_curr,256),CONGRID(b_curr,256) - message,'Writing table ' + file,/INFO - CLOSE,lun2 - ENDIF - ENDCASE - - "NEWBASE": BEGIN - mode = event.value - b = ([0, 0, 1])[mode] ;Top base to map: 0 or 1. - for i=0,1 do WIDGET_CONTROL, state.bases[i], MAP=i eq b - if b eq 0 then begin ;table or option mode? - b = ([2,3,0])[mode] ;bottom base to map (mode eq 0 or 1) - for i=2,3 do WIDGET_CONTROL, state.bases[i], MAP=i eq b - endif - if mode eq 2 then begin - reset_all = 1 - xlct_psave ;Save old state - plot, [0, ncolors-1], [0, ncolors-1], xstyle=3, $ - ystyle=3, xmargin = [1,1], ymargin=[1,1], ticklen = -0.03, $ - /NODATA, $ - xtickname = replicate(' ', 10), ytickname = replicate(' ', 10) - goto, interp_cps - endif - - ENDCASE - - "TFUNR": BEGIN - reset_tfun: - xlct_psave - xlct_draw_cps, -1, 0 ;Erase all - tfun = cps ;Linear ramp - goto, interp_cps - ENDCASE - - "REMCP": BEGIN - n = n_elements(cps) - if n gt 2 then begin - xlct_psave - xlct_draw_cps, -1, 0 - igap = 0 - for i=0, n-2 do $ - if (cps[i+1] - cps[i]) lt (cps[igap+1]-cps[igap]) then $ - igap = i - keep = where(indgen(n) ne (igap > 1)) - cps = cps[keep] - tfun = tfun[keep] - goto, interp_cps - ENDIF - ENDCASE - "ADDCP": BEGIN - xlct_psave - xlct_draw_cps, -1, 0 - igap = 0 ;Find largest gap - for i=0, n_elements(cps)-2 do $ - if (cps[i+1] - cps[i]) gt (cps[igap+1]-cps[igap]) then $ - igap = i - cps = [ cps[0:igap], (cps[igap]+cps[igap+1])/2, cps[igap+1:*]] - tfun = [ tfun[0:igap], (tfun[igap]+tfun[igap+1])/2, tfun[igap+1:*]] - interp_cps: xlct_draw_cps, -1 ;Redraw new - xlct_transfer, /update - xlct_psave ;Restore old points - if n_elements(reset_all) then goto, reset_all - ENDCASE -ENDCASE - -END - - -;+ -; NAME: -; XLOADPALETTE -; PURPOSE: -; A graphical interface to the LOADCT user library procedure. -; XLOADCT displays the current color map and provides -; an array of buttons, one per availible predefined color -; table. Using the mouse to press these buttons causes -; the corresponding color map to be loaded. -; CATEGORY: -; Widgets -; CALLING SEQUENCE: -; XLOADCT -; INPUTS: -; None. -; KEYWORDS: -; FILE: If this keyword is set, the file by the given name is used -; instead of the file colors1.tbl in the IDL directory. This -; allows multiple IDL users to have their own color table file. -; GROUP = The widget ID of the widget that calls XLoadct. When -; this ID is specified, a death of the caller results in a -; death of XLoadct -; NCOLORS = number of colors to use. Use color indices from BOTTOM -; to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. -; Default = !D.TABLE_SIZE = all available colors. -; BOTTOM = first color index to use. Use color indices from BOTTOM to -; BOTTOM+NCOLORS-1. Default = 0. -; SILENT - Normally, no informational message is printed when -; a color map is loaded. If this keyword is present and -; zero, this message is printed. -; USE_CURRENT: If set, use the current color tables, regardless of -; the contents of the COMMON block COLORS. -; MODAL: If set, then XLOADCT runs in "modal" mode, meaning that -; all other widgets are blocked until the user quits XLOADCT. -; A group leader must be specified (via the GROUP keyword) -; for the MODAL keyword to have any effect. The default -; is to not run in modal mode. -; BLOCK: Set this keyword to have XMANAGER block when this -; application is registered. By default the Xmanager -; keyword NO_BLOCK is set to 1 to provide access to the -; command line if active command line processing is available. -; Note that setting BLOCK for this application will cause -; all widget applications to block, not only this -; application. For more information see the NO_BLOCK keyword -; to XMANAGER. -; UPDATECALLBACK: Set this keyword to a string containing the name of -; a user-supplied procedure that will be called when the color -; table is updated by XLOADCT. The procedure may optionally -; accept a keyword called DATA, which will be automatically -; set to the value specified by the optional UPDATECBDATA -; keyword. -; UPDATECBDATA: Set this keyword to a value of any type. It will be -; passed via the DATA keyword to the user-supplied procedure -; specified via the UPDATECALLBACK keyword, if any. If the -; UPDATECBDATA keyword is not set the value accepted by the -; DATA keyword to the procedure specified by UPDATECALLBACK -; will be undefined. -; -; OUTPUTS: -; None. -; COMMON BLOCKS: -; None. -; SIDE EFFECTS: -; One of the predefined color maps may be loaded. -; RESTRICTIONS: -; This routine uses the LOADCT user library procedure to -; do the actual work. -; MODIFICATION HISTORY: -; 24, August, 1990, Written by AB, RSI. -; March 1, 1992 Mark Rivers added Reverse Table to options menu. -; 7/92, DMS, Added new color tables (allows more than 16). -; 9/92, ACY, Add FILE keyword. -; 10/1/96, AB, Removed the PICK_ONE keyword. It was broken for 4 years -; without anyone noticing, and the idea doesn't really fit -; XLOADCT anymore. -; 1/10/97, DJC - Fixed color bar display bug, and added "MODAL" keyword. -; 1/13/96, AB, Improved the saving and restoring of the current -; graphics window to prevent other applications from drawing -; on this applications windows. -; 1/17/97, DJC - Moved group_leader keyword from "XManager" to -; "WIDGET_BASE". Added check to ignore "MODAL" keyword -; if a group leader is not specified. -; 8/20/98, ACY - Added UPDATECALLBACK and UPDATECBDATA keywords. -;- - -PRO XLoadpalette, SILENT=silent_f, GROUP=group, FILE=file, $ - USE_CURRENT=use_current, NCOLORS = nc, BOTTOM=bottom, $ - MODAL=modal, BLOCK=block, UPDATECALLBACK=updt_cb_name, $ - UPDATECBDATA=updt_cb_data - -COMMON colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr -COMMON xloadct_com, r0, g0, b0, tfun, state, filename, cps, psave, pnt, $ - top, bot, silent, chop, lock, g_lbl, vbot, vtop, g_slider, $ - gamma, color, use_values, ncolors, cbot, siz, w_height, show_win, $ - updt_callback, p_updt_cb_data - - -IF(XRegistered("xloadct") NE 0) THEN return - -IF N_ELEMENTS(block) EQ 0 THEN block=0 -IF N_ELEMENTS(updt_cb_name) EQ 0 THEN updt_callback="" $ - ELSE updt_callback=updt_cb_name -IF N_ELEMENTS(updt_cb_data) GT 0 THEN p_updt_cb_data=PTR_NEW(updt_cb_data) $ - ELSE p_updt_cb_data=PTR_NEW() - -values_button = lonarr(2) - -IF KEYWORD_SET(SILENT_f) THEN silent = SILENT_F ELSE silent = 1 - -IF N_ELEMENTS(file) GT 0 THEN filename = file - -siz = 256 ;Basic width of tool -names = 0 -LOADPALETTE, GET_NAMES = names, FILE = file ;Get table names -w_height = 50 ;Height of ramp -cur_win = !D.WINDOW -lock = 0 -chop = 0 -vbot = 0 -vtop = 100 -gamma = 1.0 -use_values=0 - - -; Bases: -; 0 = slider base (stretch bottom, stretch top, gamma) -; 1 = transfer function drawable + buttons -; 2 = color table list -; 3 = options base (sliders. top, stretch) - -state = { bases: lonarr(4), draw: 0L, name_list: 0L } - -; DJC - Added modal keyword. -; Moved "group_leader" keyword from XMANAGER to WIDGET_BASE. -; Ignore modal keyword if a group leader is not supplied. -if (N_ELEMENTS(group) GT 0L) then $ - base = WIDGET_BASE(TITLE="XLoadct", /COLUMN, GROUP_LEADER=group, $ - MODAL=KEYWORD_SET(modal)) $ -else $ - base = WIDGET_BASE(TITLE="XLoadpalette", /COLUMN) - - -; Setting the managed attribute indicates our intention to put this app -; under the control of XMANAGER, and prevents our draw widgets from -; becoming candidates for becoming the default window on WSET, -1. XMANAGER -; sets this, but doing it here prevents our own WSETs at startup from -; having that problem. -WIDGET_CONTROL, /MANAGED, base - - -show = WIDGET_DRAW(base, YSIZE=w_height, XSIZE=siz, /FRAME, RETAIN = 2) -junk = WIDGET_BASE(base, /ROW) -save = WIDGET_BUTTON(junk, VALUE=' Save ', UVALUE = "SAVE") -done = WIDGET_BUTTON(junk, VALUE=' Done ', UVALUE = "DONE") -junk1 = WIDGET_BUTTON(junk, VALUE=' Help ', UVALUE = "HELP") - -junk = CW_BGROUP(base, /ROW, /EXCLUSIVE, /NO_REL, $ - ['Tables', 'Options', 'Function'], $ - UVALUE='NEWBASE', SET_VALUE=0) - -junk = widget_base(base) -for i=0,1 do state.bases[i] = WIDGET_BASE(junk, /COLUMN) - -sbase=WIDGET_BASE(state.bases[0], /COLUMN) -bot = WIDGET_SLIDER(sbase, TITLE = "Stretch Bottom", MINIMUM = 0, $ - MAXIMUM = 100, VALUE = 0, /DRAG, UVALUE = "BOTTOM", xsize=siz) -top = WIDGET_SLIDER(sbase, TITLE = "Stretch Top", MINIMUM = 0, $ - MAXIMUM = 100, VALUE = 100, /DRAG, UVALUE = "TOP", xsize=siz) -g_lbl = WIDGET_LABEL(sbase, VALUE = STRING(1.0)) -g_slider = WIDGET_slider(sbase, TITLE = "Gamma Correction", $ - MINIMUM = 0, MAXIMUM = 100, VALUE = 50, UVALUE = "GAMMA", $ - /SUPPRESS_VALUE, /DRAG, xsize=siz) - -junk = WIDGET_BASE(sbase) -for i=2,3 do state.bases[i] = WIDGET_BASE(junk, /COLUMN) -DEVICE, GET_SCREEN = junk -if junk[1] le 768 then junk = 8 else junk = 16 -state.name_list = WIDGET_LIST(state.bases[2], VALUE = names, ysize = junk) - - -; Drawable for transfer function - -junk = WIDGET_BASE(state.bases[1], /COLUMN, /FRAME) -junk1 = WIDGET_BUTTON(junk, VALUE = 'Reset Transfer Function', $ - UVALUE='TFUNR') -junk1 = WIDGET_BUTTON(junk, VALUE='Add Control Point', UVALUE='ADDCP') -junk1 = WIDGET_BUTTON(junk, VALUE='Remove Control Point', UVALUE='REMCP') - -state.draw = WIDGET_DRAW(state.bases[1], xsize = siz, ysize = siz, $ - /BUTTON_EVENTS, /MOTION_EVENTS) - - - opt_id = state.bases[3] - junk = CW_BGROUP(opt_id, /ROW, LABEL_LEFT='Sliders:', /EXCLUSIVE, /NO_REL, $ - ['Independent', 'Gang'], UVALUE='GANG', SET_VALUE=lock) - junk = CW_BGROUP(opt_id, /ROW, LABEL_LEFT = 'Top:', /EXCLUSIVE, /NO_REL, $ - ['Clip', 'Chop'], SET_VALUE=chop, UVALUE='CHOP') - junk = CW_BGROUP(opt_id, /ROW, LABEL_LEFT='Stretch:', /EXCLUSIVE, /NO_REL, $ - ['Indices', 'Intensity'], UVALUE='VALUES', $ - SET_VALUE=use_values) - junk = WIDGET_BUTTON(opt_id, VALUE='Reverse Table', $ - UVALUE="REVERSE", /NO_REL) - junk = WIDGET_BUTTON(opt_id, VALUE='REPLACE Original Table', $ - UVALUE = "OVERWRITE", /NO_REL) - junk = WIDGET_BUTTON(opt_id, VALUE='RESTORE Original Table', $ - UVALUE="RESTORE", /NO_REL) - -WIDGET_CONTROL, state.bases[1], MAP=0 ;Tfun is not visible -WIDGET_CONTROL, state.bases[3], MAP=0 ;options are not visible - -WIDGET_CONTROL, base, /REALIZE -WIDGET_CONTROL, state.draw, GET_VALUE=tmp - -if n_elements(bottom) gt 0 then cbot = bottom else cbot = 0 -ncolors = !d.table_size - cbot -if n_elements(nc) gt 0 then ncolors = ncolors < nc -if ncolors le 0 then message,'Number of colors is 0 or negative' - -psave = { xlct_psave, win: !d.window, x: !x.s, y: !y.s , xtype: !x.type, $ - ytype: !y.type, clip: !p.clip } -;Our initial state -wset, tmp ;Initial graph -xlct_psave ;Save original scaling & window -plot, [0, ncolors-1], [0, ncolors-1], xstyle=3, ystyle=3, $ - xmargin = [1,1], ymargin=[1,1], ticklen = -0.03, /NODATA -xlct_psave ;Restore original scaling & window - - ;If no common, use current colors -IF KEYWORD_SET(use_current) or N_ELEMENTS(r_orig) LE 0 THEN BEGIN - TVLCT, r_orig, g_orig, b_orig, /GET - r_curr = r_orig - b_curr = b_orig - g_curr = g_orig - ENDIF - -r0 = r_curr ;Save original colors -g0 = g_curr -b0 = b_curr -color = ncolors + cbot -1 -cps = [0, ncolors-1] -tfun = cps -pnt = -1 - -WIDGET_CONTROL, show, GET_VALUE=show_win -WSET, show_win - -; DJC - fixed color bar display bug. - -;TVSCL, BYTSCL(INDGEN(siz) # REPLICATE(1, w_height), top = ncolors-1) -TV, BYTE((FLOAT(ncolors)*FINDGEN(siz)/FLOAT(siz-1)) # $ - REPLICATE(1, w_height)) + BYTE(cbot) - -WSET, cur_win - -; DJC - moved GROUP_LEADER keyword to WIDGET_BASE. -XManager, "xloadpalette", base, NO_BLOCK=(NOT(FLOAT(block))), $ - MODAL=KEYWORD_SET(modal) - -END diff --git a/model/aux/make_multi_nco_cray b/model/aux/make_multi_nco_cray deleted file mode 100755 index c8745a00a..000000000 --- a/model/aux/make_multi_nco_cray +++ /dev/null @@ -1,304 +0,0 @@ -#!/bin/bash - -# Create ww3_ codes in NCO format for use at NCEP Cray - -# Run script from tree level above model directory - -# Set version number (Manually, should somewhat resemble trunk version) -WW3VER="6.02" - -# Check out latest trunk -if [ -d model ] -then -# Update model - cd model - svn update - cd .. -else - svn co https://svnemc.ncep.noaa.gov/projects/ww3/branches/ncep_opcode/model ./model -fi - -# Set WWATCH package and work directories -SAVE=`pwd` -export WWATCH3_DIR=${SAVE}/model -export WWATCH3_TMP=/gpfs/hps/stmp/emc.wavepa/make_multi/work # Scratch directory -export WWATCH3_BUILD=${SAVE}/ww3_code.v${WW3VER} - -# Create parameter indicating source-term and other code options (eg nc etc) -options=st4nc - -# FORTRAN source code extension -fextf='F90' - -echo ' ' -echo " Creating new code on ${WWATCH3_BUILD}" - -mkdir -p $WWATCH3_BUILD -mkdir -p $WWATCH3_TMP - -cd $WWATCH3_BUILD - -# Load system-specific modules -chipset=sandybridge - -source $MODULESHOME/etc/modules.sh - module load prod_util prod_envir - module load PrgEnv-intel - module unload craype-haswell - module load craype-${chipset} - - module load HDF5-serial-intel-${chipset} - module load NetCDF-intel-${chipset} - module load iobuf - -# used for multiwavegrib2 - module load jasper-gnu-${chipset} - module load png-intel-${chipset} - module load zlib-intel-${chipset} - module load g2-intel - -# used for multiwavegrib1 and grib2 - module load w3nco-intel - module load bacio-intel/2.0.2 - -# Create new env file for this build -cat > wwatch3.env << EOF -WWATCH3_LPR Printer -WWATCH3_F90 ifort -WWATCH3_CC icc -WWATCH3_DIR ${WWATCH3_DIR} -WWATCH3_TMP ${WWATCH3_TMP} -WWATCH3_SOURCE no -WWATCH3_LIST no -EOF - -export WWATCH3_ENV=${WWATCH3_BUILD}/bin/wwatch3.env - -comps=ftn -compm=ftn -progs='ww3_grid ww3_bound ww3_prep ww3_prnc ww3_multi ww3_sbs1 ww3_outf ww3_ounf ww3_ounp ww3_outp gx_outf gx_outp ww3_grib ww3_gint ww3_systrk' - -# SWITCH file -# Source term and propagation scheme choices for switch file -GEN="F90 NCO LRB4" -GRB="NCEP2" -SCRIP="SCRIP SCRIPNC" -NC="NC4" -PROP="PR3 UQ" -#STERM="ST4 STAB0 FLX0 LN1 NL3 BT1 DB1 IC0 IS0 REF0 MLIM TR0 BS0 XX0"; -STERM="ST4 STAB0 FLX0 LN1 NL1 BT1 DB1 IC0 IS0 REF0 MLIM TR0 BS0 XX0"; -WNDCUR="WNX1 WNT1 CRX1 CRT1" -OFLAG="O0 O1 O2 O4 O5 O6 O7 O14 O15" -MOV="MGP MGW MGG" - -# Define alternate switch types -# Shared memory/serial -PROC='SHRD' -GRB='NCEP2' -SBS= -SWITCH_SHRD="${GEN} ${GRB} ${PROC} ${SBS} ${SCRIP} ${NC} ${PROP} ${STERM} ${WNDCUR} ${OFLAG} ${MOV}" - -# MPI -PROC='DIST MPI' -GRB=NOGRB -SBS= -SWITCH_MPI="${GEN} ${GRB} ${PROC} ${SBS} ${SCRIP} ${NC} ${PROP} ${STERM} ${WNDCUR} ${OFLAG} ${MOV}" - -# Side-by-side multi -PROC='DIST MPI' -GRB=NOGRB -SBS='SBS' -SWITCH_SBS="${GEN} ${GRB} ${PROC} ${SBS} ${SCRIP} ${NC} ${PROP} ${STERM} ${WNDCUR} ${OFLAG} ${MOV}" - -# NetCDF libraries -NCINC='-I${NETCDF}/include' -LIBFCSTNC='-L${NETCDF}/lib -lnetcdff -lnetcdf -L${HDF5}/lib -lhdf5_hl -lhdf5 -lrt -lm -lz' - -# Define compilation options -OPTFL="-O3 -convert big_endian -assume byterecl -prec-div -prec-sqrt -ip -ftz" - -# Loop through programs -for prog in $progs -do - case $prog in - ww3_grid ) name=multiwavegrid ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - ww3_bound ) name=multiwavebound ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - ww3_prep ) name=multiwaveprep ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - ww3_prnc ) name=multiwaveprnc ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL}' -I${NETCDF}/include' ; - ldflags= ; - libs='-L${NETCDF}/lib -lnetcdff -lnetcdf -L${HDF5}/lib -lhdf5_hl -lhdf5 -lrt -lm -lz' ;; - ww3_shel ) name=multiwaveshel ; switch="$SWITCH_MPI" ; comp=$compm ; - fflags=${OPTFL}' '${NCINC} ; - ldflags= ; - libs=${LIBFCSTNC} ;; - ww3_multi ) name=multiwavefcst ; switch="$SWITCH_MPI" ; comp=$compm ; - fflags=${OPTFL}' '${NCINC} ; - ldflags= ; - libs=${LIBFCSTNC} ;; - ww3_sbs1 ) name=multiwavefcst_sbs ; switch="$SWITCH_SBS" ; comp=$compm ; - fflags=${OPTFL}' '${NCINC} ; - ldflags= ; - libs=${LIBFCSTNC} ;; - ww3_gint) name=multiwavegrid_interp ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - ww3_outp ) name=multiwavespec ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - ww3_outf ) name=multiwaveflds ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - ww3_ounf ) name=multiwavefldn ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL}' -I${NETCDF}/include' ; - ldflags= ; - libs='-L${NETCDF}/lib -lnetcdff -lnetcdf -L${HDF5}/lib -lhdf5_hl -lhdf5 -lrt -lm -lz' ;; - ww3_ounp ) name=multiwavespnc ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL}' -I${NETCDF}/include' ; - ldflags= ; - libs='-L${NETCDF}/lib -lnetcdff -lnetcdf -L${HDF5}/lib -lhdf5_hl -lhdf5 -lrt -lm -lz' ;; - ww3_grib ) name=multiwavegrib2 ; switch="$SWITCH_SHRD" ; comp=$comps ; - libs='${G2_LIB4} ${W3NCO_LIB4} ${BACIO_LIB4} ${JASPER_LIB} ${PNG_LIB} ${Z_LIB}' ; - fflags=${OPTFL} ; - ldflags= ;; - ww3_systrk) name=wavesystrk ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs='-L${NETCDF}/lib -lnetcdff -lnetcdf -L${HDF5}/lib -lhdf5_hl -lhdf5 -lrt -lm -lz' ;; - gx_outf ) name=multiwavegrads_fields ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - gx_outp ) name=multiwavegrads_points ; switch="$SWITCH_SHRD" ; comp=$comps ; - fflags=${OPTFL} ; - ldflags= ; - libs= ;; - * ) echo "do not recognize $prog." ; exit ;; - esac - -# Set up flags for w3_source -export FC=${comp} -export FFLAGS=${fflags} -export LDFLAGS=${ldflags} -export LIBS=${libs} - -rm -f ${WWATCH3_DIR}/bin/switch - -echo $switch > ${WWATCH3_DIR}/bin/switch - -# Run w3_source -echo ' ' -echo " Running w3_source for $prog " - -${WWATCH3_DIR}/bin/w3_setup ${WWATCH3_DIR} -q -c Intel - -${WWATCH3_DIR}/bin/w3_source $prog > source_${prog}.out 2>&1 - -# Move to build directory -rm -rf ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd -mkdir -p ${WWATCH3_BUILD}/${options}/exec -mkdir -p ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd -mv -f ${WWATCH3_DIR}/work/$prog.tar.gz ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd -tar zxvf ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd/$prog.tar.gz -C ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd > /dev/null 2>&1 -rm -f ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd/$prog.tar.gz - - -cd ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd/ - - echo " Changing ${prog} and input file to NCO main program name " - echo ' ' - - case $prog in - ww3_grid ) sed -e 's/W3GRID/WAVEGRID/g' \ - -e 's/ww3_grid/${name}/g' $prog.${fextf} > $name.${fextf} - sed -e 's/NOSW = 5/NOSW = 2/g' $name.${fextf} > ${name}.dummy - mv ${name}.dummy ${name}.${fextf} - rm -f $prog.${fextf} ;; - ww3_bound ) sed -e 's/W3BOUND/WAVEBOUND/g' \ - -e 's/ww3_bound/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_prep ) sed -e 's/W3PREP/WAVEPREP/g' \ - -e 's/ww3_prep/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_prnc ) sed -e 's/W3PRNC/WAVEPRNC/g' \ - -e 's/ww3_prnc/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_shel ) sed -e 's/W3SHEL/WAVEFCST/g' \ - -e 's/ww3_shel/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_multi ) sed -e 's/W3SHEL/WAVEFCST/g' \ - -e 's/ww3_multi/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_sbs1 ) sed -e 's/W3SHEL/WAVEFCST/g' \ - -e 's/ww3_multi/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_gint ) sed -e 's/W3GRID_INT/WAVEGRID_INT/g' \ - -e 's/ww3_gint/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_grib ) sed -e 's/W3GRIB/WAVEGRIB2/g' \ - -e 's/ww3_grib/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_outp ) sed -e 's/W3OUTP/WAVESPEC/g' \ - -e 's/ww3_outp/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_outf ) sed -e 's/W3OUTF/WAVEFLDS/g' \ - -e 's/ww3_outf/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_ounp ) sed -e 's/W3OUNF/WAVESPNC/g' \ - -e 's/ww3_ounp/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_ounf ) sed -e 's/W3OUNF/WAVEFLDS/g' \ - -e 's/ww3_ounf/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - ww3_systrk ) sed -e 's/W3SYSTRK/WAVESYSTRK/g' -e 's/WW3_SYSTRK/WAVESYSTRK/g'\ - -e 's/ww3_systrk/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - gx_outf ) sed -e 's/GXOUTF/WAVEGXFL/g' \ - -e 's/gx_outf/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - gx_outp ) sed -e 's/GXOUTP/WAVEGXSP/g' \ - -e 's/gx_outp/${name}/g' $prog.${fextf} > $name.${fextf} - rm -f $prog.${fextf} ;; - * ) if [ "$prog" != "$name" ] - then - mv $prog.${fextf} $name.${fextf} - fi;; - esac - -# Change makefile to reflect NCO main prog name - sed -e "s/$prog/$name/g" makefile > makefile.temp - - mv makefile.temp makefile - rm -rf ${WWATCH3_BUILD}/${options}/sorc/${name}.fd - mv ${WWATCH3_BUILD}/${options}/sorc/${prog}.fd ${WWATCH3_BUILD}/${options}/sorc/${name}.fd - -cd $WWATCH3_BUILD/${options}/sorc/${name}.fd - -make clean -make > $WWATCH3_BUILD/${options}/sorc/${name}.fd/make.${name}.out 2>&1 -mv -f $WWATCH3_BUILD/${options}/sorc/${name}.fd/${name} $WWATCH3_BUILD/${options}/exec -make clean - -# Remove obj and mod files to ensure switch options are enforced -rm -f ${WWATCH3_DIR}/obj*/* -rm -f ${WWATCH3_DIR}/mod*/* - -done - -# Copy make.codes.sh script from aux/scripts -#cp ${SAVE}/aux/scripts/make.codes.sh ${WWATCH3_BUILD}/${options}/sorc/ - -echo ' ' -echo " All done " diff --git a/model/aux/matlab/example_plot_from_netcdf_rect.m b/model/aux/matlab/example_plot_from_netcdf_rect.m deleted file mode 100644 index b919fa929..000000000 --- a/model/aux/matlab/example_plot_from_netcdf_rect.m +++ /dev/null @@ -1,42 +0,0 @@ -% example_plot_rect -% -% example of using read_WWNC_var and plotting some results -% -% Here is how you can obtain the sample data: -% p1='http://tinyurl.com/iowagaftp/HINDCAST' -% p2='2011_ECMWF/hs' -% wget ${p1}/GLOBAL/${p2}/ww3.201102_hs.nc -O ww3.201102_hs-global.nc -% wget ${p1}/ATNE/${p2}/ww3.201102_hs.nc -O ww3.201102_hs-atne.nc -% wget ${p1}/NORGASUG/${p2}/ww3.201102_hs.nc -O ww3.201102_hs-ngug.nc - - -filename='ww3.201102_hs-global.nc'; % This example uses a file with only hs in it -%filename='ww3.201102_hs-atne.nc'; % This example uses a file with only hs in it - -varname='hs'; -[lat,lon,time,mat1,var1,unit1]=read_WWNC_var(filename,varname); - -% Looks for a specific time: here 2011/2/15 at 18:00:00 UTC -tt=find(time >= datenum(2011,2,15,21,0,0)); -it=tt(1); - - -rundate = time(it); -figure(1) -clf -pcolor(lon,lat,double(squeeze(mat1(:,:,it)))') -shading flat; -colormap(jet);colorbar; -caxis([0 10]); -latmin=min(lat); -latmax=max(lat); -coslat=cos(0.5*(latmax+latmin)*pi/180); -set(gca,'DataAspectRatio',[1 coslat 1]); %# data aspect ratio - -title(['H_{m0} (m): ' datestr(rundate,31)]); -xlabel('Longitude (deg)') -ylabel('Latitude (deg)') - -%print(gcf,'-dpng',[filename '_it' num2str(it,'%3.3d') '.png']) - - diff --git a/model/aux/matlab/example_plot_from_netcdf_unst.m b/model/aux/matlab/example_plot_from_netcdf_unst.m deleted file mode 100644 index 64d6eb612..000000000 --- a/model/aux/matlab/example_plot_from_netcdf_unst.m +++ /dev/null @@ -1,47 +0,0 @@ -% example_plot_unst -% -% example of using read_WWNC_var and plotting some results -% This is for model output on a triangular mesh. - -% Here is how you can obtain the sample data: -% p1='http://tinyurl.com/iowagaftp/HINDCAST' -% p2='2011_ECMWF/hs' -% wget ${p1}/GLOBAL/${p2}/ww3.201102_hs.nc -O ww3.201102_hs-global.nc -% wget ${p1}/ATNE/${p2}/ww3.201102_hs.nc -O ww3.201102_hs-atne.nc -% wget ${p1}/NORGASUG/${p2}/ww3.201102_hs.nc -O ww3.201102_hs-ngug.nc - - -% -it=0 -%filename='ANTILLES_FORECAST.nc';it=10; % This example uses a file with - % many variables -filename='ww3.201102_hs-ngug.nc'; % This example uses a file with - % with only hs in it -varname='hs'; -[tri,lat,lon,time,mat1,var1,unit1]=read_WWNC_UG_var(filename,varname); - -if it==0 -% Looks for a specific time: here 2011/2/15 at 18:00:00 UTC -tt=find(time >= datenum(2011,2,15,21,0,0)); -it=tt(1); -end - -rundate = time(it); -figure(2) -%clf -trisurf(tri',lon,lat,mat1(:,it)) -view(0,90);shading interp; -colormap(jet);colorbar; -caxis([0 10]); -latmin=min(lat); -latmax=max(lat); -coslat=cos(0.5*(latmax+latmin)*pi/180); -set(gca,'DataAspectRatio',[1 coslat 1]); %# data aspect ratio - -title(['H_{m0} (m): ' datestr(rundate,31)]); -xlabel('Longitude (deg)') -ylabel('Latitude (deg)') - -%print(gcf,'-dpng',[filename '_it' num2str(it,'%3.3d') '.png']) - - diff --git a/model/aux/matlab/example_plotf_from_netcdf_rect.m b/model/aux/matlab/example_plotf_from_netcdf_rect.m deleted file mode 100644 index 968837976..000000000 --- a/model/aux/matlab/example_plotf_from_netcdf_rect.m +++ /dev/null @@ -1,68 +0,0 @@ -i% example_plotf_from_netcdf_rect -% -% example of using read_WWNCf_var and plotting some results: -% this reads frequency-dependent parameters. In the example here -% we read the energy spectrum E(f). -% -% Here is how you can obtain the sample data: -% Warning this is a VERY BIG file (1.6 Gb). -% Hopefully it will be soon accessible via OpenDAP. -% -% p1='http://tinyurl.com/iowagaftp/HINDCAST' -% p2='2011_ECMWF/ef' -% wget ${p1}/GLOBAL/${p2}/ww3.201102_ef.nc -O ww3.201102_ef.nc - - -% -clear all; -close all; - -% Example for seismic noise sources -%filename='ww3.200803_p2l.nc'; -%date1=datenum(2008,03,20,12,0,0); -%varname='Fp3D'; - -% Example for wave spectra -filename='ww3.201102_ef.nc'; -date1=datenum(2011,02,15,18,0,0); -varname='ef'; - -[lat,lon,freq,time,mat1,var1,unit1,MAPSTA]=read_WWNCf_var(filename,varname,date1); - -rundate = date1; -% -% choice of frequency -% -%jf=10; -jj=find(freq <= 0.05); -df=freq.*(0.5*(1.1-1/1.1)); % Only good if XFR =1.1 in WW3 -nx=length(lon); -ny=length(lat); -matplot=zeros(nx,ny); -for i=1:length(jj) - efmap=double(squeeze(mat1(:,:,jj(1)))); - %min(min(efmap)) - %max(max(efmap)) - matplot=matplot+efmap.*df(jj(i)); - -end -matplot=4.*sqrt(double(matplot)); - -figure(2) -clf -pcolor(lon,lat,matplot') -shading flat; -colormap(jet);colorbar; -latmin=min(lat); -latmax=max(lat); -coslat=cos(0.5*(latmax+latmin)*pi/180); -set(gca,'DataAspectRatio',[1 coslat 1]); %# data aspect ratio - -title(['Hs for T > 20 s (m) on ' datestr(rundate,31) ]); -%title(['F_{p3D}(2f,k~0)/(\rho_w^2 g^2) (m^4/Hz): ' datestr(rundate,31) ', f=' num2str(freq(jf)) 'Hz' ]); -xlabel('Longitude (deg)') -ylabel('Latitude (deg)') - -%print(gcf,'-dpng',[filename '_it' num2str(it,'%3.3d') '.png']) - - diff --git a/model/aux/matlab/example_read_spectrum.m b/model/aux/matlab/example_read_spectrum.m deleted file mode 100755 index 6eb222ee6..000000000 --- a/model/aux/matlab/example_read_spectrum.m +++ /dev/null @@ -1,184 +0,0 @@ -% -% Example of reading and plotting directional spectra from NetCDF files. -% Sample files can be found at : -% ftp://ftp.ifremer.fr/ifremer/cersat/products/gridded/wavewatch3/HINDCAST/GLOBAL/2008_ECMWF/SPECTRA_NC/ -% Note: you may have to wait for the listing to appear (over 9000 files ...) -% -clear all -close all -addpath('~/TOOLS/MATLAB') -filename='ww3.62069_2008_spec.nc' -varname='efth'; -[lat,lon,freq,dir,df,dates,Efth,depth,curr,currdir,unit1]=readWWNC_SPEC(filename,varname); -nth=size(Efth,1); -nk=size(Efth,2); -dth=360/nth; -% -% Reads a color table -% -col=load('doppler_modified_land_2.ct'); -col(:,254)=col(:,253); -col(:,255)=col(:,253); -col(:,256)=col(:,253); -% -% Converting directions from nautical to trigonometric convention x=90-w -% and from 'To' to 'From' convention: y = x + 180 -% and shifts by half bin to have the polygons centered: z = z -dth/2; -% -dirmemo=dir; -dir=(90.-dir)+180-dth/2; -dtor=pi/180; -% -% Selects one of the time steps in the file -% -%I=find (dates >= datenum(2008,3,12) ); -%i=I(1) -i=1000; -Efth1(:,:)=double(Efth(:,:,1,i)'); -% Displays the date onf that step (year month day hour minute second) -datevec(dates(i)) -% - -%------------------------------------------------------------- -% 1. Polar plot display -%------------------------------------------------------------- -% The first direction is repeated at the end in order to make -% a nice plot -dirr=[dir' dir(1)]'; -dir2=repmat(dirr',nk,1); -freq2=repmat(freq,1,nth+1); -Efth2(:,1:nth)=Efth1; -Efth2(:,nth+1)=Efth1(:,1); -x2=cos(dir2.*dtor).*freq2; % - sign converts direction "to" to direction "from" -y2=sin(dir2.*dtor).*freq2; -% -figure(1); -colormap(col'./255); -pcolor(x2,y2,Efth2);axis equal;shading flat; -hold on; -for i=1:7 - plot(0.1*i*cos(linspace(0,2*pi,25)),0.1*i*sin(linspace(0,2*pi,25))) -end - -% Integrates over frequencies and plots the freq. spectrum -figure(2); -clf -dth=360./real(nth); -dthr=2.*pi./real(nth); - -Ef=sum(Efth1,2)*dthr; -% Computes the directional integral that comes into the seismic noise -% source -DirInt = 2*sum(Efth1(:,1:nth/2).*Efth1(:,nth/2+1:nth),2)*dthr./(Ef.^2); - - -Hs=4.*sum(Ef.*df) -plot(freq,Ef,'k-+','LineWidth',2); -set(gca,'FontSize',15); -xlabel('Frequency (Hz)'); -ylabel('E(f) (m^2/Hz)'); - -dir=90+dirmemo; -% Computes mean directions and directional spread -dir2=repmat(dir',nk,1); -a1=sum(Efth1.*cos(dir2.*dtor),2).*dthr./Ef; -b1=sum(Efth1.*sin(dir2.*dtor),2).*dthr./Ef; - -m1=sqrt(a1.^2+b1.^2); -sth1m=sqrt(2*(1-m1))*180/pi; - -figure(5); -clf -th1m=atan2(b1,a1)*180/pi; -plot(freq,th1m,'k-','LineWidth',2); -set(gca,'FontSize',15); -xlabel('Frequency (Hz)'); -ylabel('mean direction th1m (deg)'); - - -figure(6); -clf -plot(freq,sth1m,'k-','LineWidth',2); -set(gca,'FontSize',15); -xlabel('Frequency (Hz)'); -ylabel('directional spread (deg)'); - - - - -%------------------------------------------------------------- -% 2. Simulates a surface assuming linear superposition -%------------------------------------------------------------- -% a . gets phases from random draw -phases=rand(nk,nth)*2*pi; - -% b. Computes amplitudes -% b.1 frequency increment -df=freq.*(1.1-1/1.1)./2; -% b.2 direction increment in radians -as=zeros(nk,nth); -for i=1:nk - as(i,:)=sqrt(2.*Efth1(i,:)*df(i)*dthr); - %as(:,2:end)=0; -end - -% c. definition du domaine de realisation de la surface (carre de 1 km par 1km) -nx=201; -x=linspace(0,1000,nx); -y2=repmat(x',1,nx); -x2=repmat(x,nx,1); -y=x; -g=9.81; -%%% Computes the wave numbers -sig=2*pi.*freq; -ks=sig.^2./g;% ... ?? use the dispersion relation. Here for deep water. - % How would it be for a different depth? - -% d. Prepares for a movie with nt timesteps -nt=20; -t=linspace(0,(nt-1)*0.5,nt); -% Loads a "nice" color table -col=load('doppler_modified_land_2.ct'); -col(:,254)=col(:,253); -col(:,255)=col(:,253); -col(:,256)=col(:,253); -colormap(col'./255); - -nfig=3; -figure(nfig); -clf -set(nfig,'Position',[1 1 3*nx+40 3*nx+40]) -colormap(col'./255); -M=struct([]); -mov = avifile('example_surface.avi'); -for ii=1:nt -% -% initialise la surface a zero -% -dirt=(90.-dirmemo); -zeta=zeros(nx,nx); -E=0; -for i=1:nk - for j=1:nth - zeta(:,:)= zeta(:,:)+as(i,j)*cos( ks(i)*cos(dirt(j).*dtor).*x2 ... - +ks(i)*sin(dirt(j).*dtor).*y2 + phases(i,j)-sig(i)*t(ii) ); - E=E+as(i,j).^2.; - end -end -pcolor(x2,y2,zeta); -if ii == 1 -hs=4*sqrt(E); -caxis([-Hs,Hs]); -end -axis equal;shading interp;colorbar; -xlabel('x (m)'); -ylabel('y (m)'); -N(ii)=getframe; -F=getframe; -mov = addframe(mov,F); -end -% Checks that the Hs is indeed 4 x stdev(elevation) -hs=4*sqrt(E) - -mov = close(mov); -movie(N,1,1) diff --git a/model/aux/matlab/read_WWNCUG_var.m b/model/aux/matlab/read_WWNCUG_var.m deleted file mode 100644 index bc9aaaeda..000000000 --- a/model/aux/matlab/read_WWNCUG_var.m +++ /dev/null @@ -1,84 +0,0 @@ - -function [tri,lat,lon,time,mat1,var1,unit1]=read_WWNCUG_var(filename,varname,date1,lon1,lat1) -% -% Reads all or a subsed of a NetCDF file. -% If date1 is specified: takes only the closest dates in the file -% if lon1 is specificied: takes only the closest longitude ... - -% -% 1. Opens file and gets dimensions of arrays -% - fid=netcdf.open(filename,'NC_NOWRITE'); - nodeid=netcdf.inqDimID(fid,'node'); - elemid=netcdf.inqDimID(fid,'element'); - timeid=netcdf.inqDimID(fid,'time'); - - [d0,nx]=netcdf.inqDim(fid,nodeid); - [d1,ntri]=netcdf.inqDim(fid,elemid); - [d3,nt]=netcdf.inqDim(fid,timeid); - - varlon = netcdf.inqVarID(fid,'longitude'); - varlat = netcdf.inqVarID(fid,'latitude'); - vartri = netcdf.inqVarID(fid,'tri'); - - lon=netcdf.getVar(fid,varlon); - lat=netcdf.getVar(fid,varlat); - tri=netcdf.getVar(fid,vartri); - - - -% -% We assume that the date reference is 1 Jan 1990. -% This is normally written in the time attributes -% - time0=datenum(1990,1,1); - vartime = netcdf.inqVarID(fid,'time'); - time=netcdf.getVar(fid,vartime)+time0; - varids=[]; -myvar= netcdf.inqVarID(fid,varname); - -% -% Gets all the indices for the variables -% - [var1 type vardims]=netcdf.inqVar(fid,myvar); -% -% 2. defines the indices for the data subset -% -if exist('date1') - [timedist,kk]=min(abs(time-date1)); - time=time(kk); - KK=kk; - nk=1; -else - KK=1; - nk=nt; -end -if exist('lon1') & exist('lat1') - [xdist,ii]=min(abs(lon-lon1)+abs(lat-lat1)); - lon=lon(ii); - lat=lat(ii); - II=ii; - ni=1; -else - II=1; - ni=nx; -end - -% -% 3. Extracts data -% - j=1; - j1=j; - varid=myvar; - eval(['unit' num2str(j) '=netcdf.getAtt(fid,varid,''units'');']); - eval(['scale=netcdf.getAtt(fid,varid,''scale_factor'');']); - eval(['fillv=netcdf.getAtt(fid,varid,''_FillValue'');']); - eval(['vali=netcdf.getVar(fid,varid,[II-1 KK-1],[ni nk]);']); - I=find(vali== fillv); - val=double(vali).*scale; - val(I)=NaN; - eval(['mat' num2str(j) '=val;']); - -netcdf.close(fid); - - diff --git a/model/aux/matlab/read_WWNC_var.m b/model/aux/matlab/read_WWNC_var.m deleted file mode 100644 index 83af987c8..000000000 --- a/model/aux/matlab/read_WWNC_var.m +++ /dev/null @@ -1,90 +0,0 @@ - -function [lat,lon,time,mat1,var1,unit1]=read_WWNC_var(filename,varname,date1,lon1,lat1) -% -% Reads all or a subsed of a NetCDF file. -% If date1 is specified: takes only the closest dates in the file -% if lon1 is specificied: takes only the closest longitude ... - -% -% 1. Opens file and gets dimensions of arrays -% - fid=netcdf.open(filename,'NC_NOWRITE'); - [ndims,nvars,ngatts,unlimdimid]=netcdf.inq(fid); - [d0,nx]=netcdf.inqDim(fid,ndims-3); - [d1,ny]=netcdf.inqDim(fid,ndims-2); - [d2,nt]=netcdf.inqDim(fid,ndims-1); - v0=netcdf.inqVar(fid,0); - if (v0=='x') - varlon=0; - varlat=1; - else - varlon = netcdf.inqVarID(fid,'longitude'); - varlat = netcdf.inqVarID(fid,'latitude'); - end - lon=netcdf.getVar(fid,varlon); - lat=netcdf.getVar(fid,varlat); -% -% We assume that the date reference is 1 Jan 1990. -% This is normally written in the time attributes -% - time0=datenum(1990,1,1); - vartime = netcdf.inqVarID(fid,'time'); - time=netcdf.getVar(fid,vartime)+time0; - varids=[]; -myvar= netcdf.inqVarID(fid,varname); - -% -% Gets all the indices for the variables -% - [var1 type vardims]=netcdf.inqVar(fid,myvar); -% -% 2. defines the indices for the data subset -% -if exist('date1') - [timedist,kk]=min(abs(time-date1)); - time=time(kk); - KK=kk; - nk=1; -else - KK=1; - nk=nt; -end -if exist('lon1') - [xdist,ii]=min(abs(lon-lon1)); - lon=lon(ii); - II=ii; - ni=1; -else - II=1; - ni=nx; -end -if exist('lat1') - [ydist,jj]=min(abs(lat-lat1)); - lat=lat(jj); - JJ=jj; - nj=1; -else - JJ=1; - nj=ny; -end - -% -% 3. Extracts data -% - j=1; - j1=j; - varid=myvar; - eval(['unit' num2str(j) '=netcdf.getAtt(fid,varid,''units'');']); - eval(['scale=netcdf.getAtt(fid,varid,''scale_factor'');']); - eval(['fillv=netcdf.getAtt(fid,varid,''_FillValue'');']); - eval(['vali=netcdf.getVar(fid,varid,[II-1 JJ-1 KK-1],[ni nj nk]);']); - %eval(['var' num2str(j) '=netcdf.getAtt(fid,var' num2str(j) 'id,''long_name'');']); - I=find(vali== fillv); - val=double(vali).*scale; - val(I)=NaN; - eval(['mat' num2str(j) '=val;']); - -netcdf.close(fid); -% pcolor(lon1,lat1,squeeze(val1(:,:,1))');shading flat; - - diff --git a/model/aux/matlab/read_WWNCf_var.m b/model/aux/matlab/read_WWNCf_var.m deleted file mode 100644 index 9a809c29b..000000000 --- a/model/aux/matlab/read_WWNCf_var.m +++ /dev/null @@ -1,287 +0,0 @@ - - -function [lat,lon,freq,time,mat1,var1,unit,MAPSTA]=read_WWNCf_var(filename,varname,date1,lon1,lat1) - -% - -% Reads all or a subset of a NetCDF file, with a frequency dimension. - -% If date1 is specified: takes only the closest dates in the file - -% if lon1 is specificied: takes only the closest longitude ... - - - -% - -% 1. Opens file and gets dimensions of arrays - -% - - fid=netcdf.open(filename,'NC_NOWRITE'); - - [ndims,nvars,ngatts,unlimdimid]=netcdf.inq(fid); - - - - MAPSTAid=netcdf.inqVarID(fid,'MAPSTA'); - - - - dimlon = netcdf.inqDimID(fid,'longitude'); - - dimlat = netcdf.inqDimID(fid,'latitude'); - - dimtime = netcdf.inqDimID(fid,'time'); - - dimf = netcdf.inqDimID(fid,'f'); - - [d0,nx]=netcdf.inqDim(fid,dimlon); - - [d1,ny]=netcdf.inqDim(fid,dimlat); - - [d3,nt]=netcdf.inqDim(fid,dimtime); - - [d4,nf]=netcdf.inqDim(fid,dimf); - - v0=netcdf.inqVar(fid,0); - - if (v0=='x') - - varlon=0; - - varlat=1; - - else - - varlon = netcdf.inqVarID(fid,'longitude'); - - varlat = netcdf.inqVarID(fid,'latitude'); - - end - - varf = netcdf.inqVarID(fid,'f'); - - varM = netcdf.inqVarID(fid,'MAPSTA'); - - freq=netcdf.getVar(fid,varf); - - MAPSTA=netcdf.getVar(fid,varM); - - lon=netcdf.getVar(fid,varlon); - - lat=netcdf.getVar(fid,varlat); - -% - -% We assume that the date reference is 1 Jan 1990. - -% This is normally written in the time attributes - -% - - time0=datenum(1990,1,1); - - vartime = netcdf.inqVarID(fid,'time'); - - time=netcdf.getVar(fid,vartime)+time0; - - varids=[]; - -myvar= netcdf.inqVarID(fid,varname); - - - -% - -% Gets all the indices for the variables - -% - - [var1 type vardims]=netcdf.inqVar(fid,myvar); - -% - -% 2. defines the indices for the data subset - -% - -if exist('date1') - - [timedist,kk]=min(abs(time-date1)); - - time=time(kk); - - KK=kk; - - nk=1; - -else - - KK=1; - - nk=nt; - -end - -if exist('lon1') - - [xdist,ii]=min(abs(lon-lon1)); - - lon=lon(ii); - - II=ii; - - ni=1; - -else - - II=1; - - ni=nx; - -end - -if exist('lat1') - - [ydist,jj]=min(abs(lat-lat1)); - - lat=lat(jj); - - JJ=jj; - - nj=1; - -else - - JJ=1; - - nj=ny; - -end - - - -LL=1; - -nl=nf; - - - -% - -% 3. Extracts data - -% - - unit=netcdf.getAtt(fid,myvar,'units'); - - scale=netcdf.getAtt(fid,myvar,'scale_factor'); - - fillv=netcdf.getAtt(fid,myvar,'_FillValue'); - - vali=netcdf.getVar(fid,myvar,[II-1 JJ-1 LL-1 KK-1],[ni nj nl nk]); - - - -% - -% Converts to normal units in case of log scales ... - -% - - lg10=log(10); - - tabOK=0; - - imin=-2^15+1; - - imax=2^15; - - tabmat=linspace(imin,imax,imax-imin+1); - -lenu=length(unit); - - if unit(1:15) == 'log10(m4s+1E-12' - - tabmat=exp(lg10.*tabmat.*scale)-(1E-12-1E-16); - - tabOK=1; - - end - - if unit(1:15) == 'log10(m4s+0.01)' - - tabmat=exp(lg10.*tabmat.*scale)-0.009999; - - tabOK=2; - - end - - - -if (lenu >= 17) - - if unit(1:17) == 'log10(Pa2s+1E-12)' - - tabmat=exp(lg10.*tabmat.*scale)-(1E-12-1E-16); - - tabOK=2; - - end - - if unit(1:17) == 'log10(m2 s+1E-12)' - - tabmat=exp(lg10.*tabmat.*scale)-(1E-12-1E-16); - - tabOK=2; - - end - -end - - - -if (lenu >= 18) - -if unit(1:18) == 'log10(Pa2 s+1E-12)' - - tabmat=exp(lg10.*tabmat.*scale)-(1E-12-1E-16); - - tabOK=2; - -end - -end - - - - - -if tabOK > 0 - - mat1=tabmat(imax+int32(squeeze(vali))); - - I=find(vali== fillv); - - mat1(I)=NaN; - - - -else - - I=find(vali== fillv); - - val=double(vali).*scale; - - val(I)=NaN; - - eval(['mat' num2str(j) '=val;']); - -end - -netcdf.close(fid); - -% pcolor(lon1,lat1,squeeze(val1(:,:,1))');shading flat; - - diff --git a/model/aux/matlab/read_outf_hs_generic.m b/model/aux/matlab/read_outf_hs_generic.m deleted file mode 100644 index 85641efb6..000000000 --- a/model/aux/matlab/read_outf_hs_generic.m +++ /dev/null @@ -1,146 +0,0 @@ -function read_outf_hs_generic(time_filename,hmax,dt,axisin,ext,variablename,units,plot_bathy,iprint,ifig) - -% Purpose: scan depth (if ploty_bath==1) and Hs files -% and make simple x,y plots and save fields -% to a .mat file. The x,y plots are just for simple diagnostics. It is -% assumed that the .mat file will subsequently be used to make better -% plots (especially in case of curvilinear grid, since plot will be -% distorted here). -% Example input: time_filename=datenum(1968,06,06,0,0,0);hmax=5; dt=1/24;axisin=[];ext='hs';variablename='SWH';units{1}='deg';units{2}='m';plot_bathy=0; - - -% Name: read_outf_hs_generic.m -% Origination: E Rogers -% This header last updated: E Rogers Jan 11 2013 - -icheck=1; - -fz=12; -set(0,'defaultaxesfontsize',fz); - -BUFFER=1; - -wermap=jet; -wermap(1,:)=[0 0.6 0]; - -v2=[-10 0 10]; - -for itime=1:1000 - - Z1=datestr(time_filename,30); - Z2=[Z1(3:8) Z1(10:11)]; - - if itime==1 & plot_bathy==1 - - filename=['./ww3.' Z2 '.dpt']; - - if exist(filename) == 0 - disp([filename ' does not exist']) - break - end - if exist(filename) == 2 - disp([filename ' does exist.']) - - [xgrd,ygrd,depth,year,month,day,hour,minute]=read_scalar(filename,icheck); - time(itime)=datenum(year,month,day,hour,minute,0); - icheck=0; - - figure(1),clf,hold off - imagesc(xgrd,ygrd,depth') - colormap(jet) - axis xy - axis equal - if isempty(axisin)==1 - axis1=[min(min(xgrd))-BUFFER max(max(xgrd))+BUFFER min(min(ygrd))-BUFFER max(max(ygrd))+BUFFER]; - else - axis1=axisin; - end - axis(axis1) - xlabel(['x (' units{1} ')'],'fontsize',(fz+2)) - ylabel(['y (' units{1} ')'],'fontsize',(fz+2)) - set(gca,'fontsize',fz) - caxis([-300 300]) - colorbar - title(['depth (m) ; ' datestr(time(itime),0)]) - pause(0.1) - end - - end - - filename=['./ww3.' Z2 '.' ext]; - - if exist(filename) == 0 - disp([filename ' does not exist']) - break - end - if exist(filename) == 2 - disp([filename ' does exist; itime = ' num2str(itime)]) - - str=['[xgrd,ygrd,' variablename ',year,month,day,hour,minute]=read_scalar(filename,icheck);'];eval(str) - filenames{itime}=filename; % for error checking - time_filenames(itime)=time_filename; % for error checking - time(itime)=datenum(year,month,day,hour,minute,0); - icheck=0; - -% This operation is disabled since depth at first time step may not apply for this field -% (depth field is affected by nonstationary ice, for example) -% if plot_bathy==1 -% [i]=find(depth<0); -% str=[' ' variablename '(i)=-99;'];eval(str) -% end - - figure(ifig),clf,hold off - str=[' imagesc(xgrd,ygrd,' variablename ''')'];eval(str) - colormap(wermap) - axis xy - axis equal - if isempty(axisin)==1 - axis1=[min(min(xgrd))-BUFFER max(max(xgrd))+BUFFER min(min(ygrd))-BUFFER max(max(ygrd))+BUFFER]; - else - axis1=axisin; - end - axis(axis1) - xlabel(['x (' units{1} ')'],'fontsize',(fz+2)) - ylabel(['y (' units{1} ')'],'fontsize',(fz+2)) - set(gca,'fontsize',fz) - caxis([-hmax/63 hmax]) - colorbar - if plot_bathy==1 - hold on - contour(xgrd,ygrd,depth',v2,'w-') - end - title([variablename ' (' units{2} ') ; ' datestr(time(itime),0)]) - pause(0.1) - if iprint==1 - icount=icount+1; - if icount==1 - print -dpsc2 outf.ps - else - print -dpsc2 -append outf.ps - end - end - - time_filename=time_filename+dt; -% round to nearest minute to avoid limits of precision in dt that causes creepage over many time steps - time_filename=round(time_filename*1440)/1440; - - str=[' ' variablename '_t{itime}=' variablename ';'];eval(str) - - end - -end - -%print -dpsc2 pcolor.final.ps -%print -dpng pcolor.final.png - -if exist('xgrd')==0 - error('did you put in the correct date?') -end - -disp('saving final .mat file....') -if plot_bathy==1 - str=['save ' variablename '.OUTF.mat xgrd ygrd depth ' variablename '_t time'];eval(str) -else - str=['save ' variablename '.OUTF.mat xgrd ygrd ' variablename '_t time'];eval(str) -end -disp('....done') diff --git a/model/aux/matlab/read_scalar.m b/model/aux/matlab/read_scalar.m deleted file mode 100644 index 361904cc8..000000000 --- a/model/aux/matlab/read_scalar.m +++ /dev/null @@ -1,78 +0,0 @@ -function [xgrid,ygrid,height,year,month,day,hour,minute]=read_scalar(filename,icheck) -% usage: function [xgrid,ygrid,height,year,month,day,hour]=read_scalar(filename) -% example usage : -% read_scalar('ww3.01011021.hs'); - -% Name: read_scalar.m -% Purpose: read .hs files, and similar files -% Origination: E Rogers -% This header last updated: E Rogers Jan 11 2013 - -fid = fopen(filename,'r'); -header=fgets(fid); -C = textscan(header,'%s'); -YYYYMMDD=C{1}{3}; -HHMMSS=C{1}{4}; - -year=str2num(YYYYMMDD(1:4)); -month=str2num(YYYYMMDD(5:6)); -day=str2num(YYYYMMDD(7:8)); -hour=str2num(HHMMSS(1:2)); -minute=str2num(HHMMSS(3:4)); - -xmin=str2num(C{1}{5}); -xmax=str2num(C{1}{6}); -nx=str2num(C{1}{7}); -ymin=str2num(C{1}{8}); -ymax=str2num(C{1}{9}); -ny=str2num(C{1}{10}); -variable=C{1}{11}; -factors=str2num(C{1}{12}); - -if icheck>0 - str=['!head -n 1 ' filename];disp(str);eval(str) - disp(['year = ' num2str(year)]) - disp(['month = ' num2str(month)]) - disp(['day = ' num2str(day)]) - disp(['hour = ' num2str(hour)]) - disp(['minute = ' num2str(minute)]) - disp(['xmin = ' num2str(xmin)]) - disp(['xmax = ' num2str(xmax)]) - disp(['nx = ' num2str(nx)]) - disp(['ymin = ' num2str(ymin)]) - disp(['ymax = ' num2str(ymax)]) - disp(['ny = ' num2str(ny)]) - disp(['factors = ' num2str(factors)]) -end - -dx=(xmax-xmin)/(nx-1); -dy=(ymax-ymin)/(ny-1); -xgrid=xmin:dx:xmax; -ygrid=ymin:dy:ymax; -if nx ~= size(xgrid,2); - error('uh oh.') -end -if ny ~= size(ygrid,2); - error('uh oh.') -end - -disp('scanning data.....') -for j=1:ny - for i=1:nx - height(i,j)=fscanf(fid,'%f',1); - end -end -disp('done scanning data.') -height=height .* factors; - -fclose(fid); - -disp(['variable read is ' variable]) - -if icheck>1 - beep - iq=input('Do the variables look ok (1=yes)? '); - if iq ~= 1 - error('does not look ok, stopping') - end -end diff --git a/model/aux/matlab/write_x_and_y_example.m b/model/aux/matlab/write_x_and_y_example.m deleted file mode 100644 index 576729ff9..000000000 --- a/model/aux/matlab/write_x_and_y_example.m +++ /dev/null @@ -1,88 +0,0 @@ - -clear - -% Name: write_x_and_y_example.m -% Purpose: Make example curvilinear grid -% Origination: E Rogers March 11 2008 -% Updated: E Rogers Jan 8 2013 -% Notes: -% ..1) This grid is used with /regtests/ww3_tp2.1/input/ww3_grid_c.inp -% ..2) This test case (tp2.1c) is an idealized deepwater case: -% .......depths are specified in ww3_grid_c.inp -% ..3) General remarks about irregular grids: -% .......irregular grids are logically rectangular, specified as -% .......x(i,j) and y(i,j). (This script creates these two arrays.) -% .......x varies in i or j or both. -% .......y varies in i or j or both. -% .......Grid lines can be straight. For example, you might have a grid -% ...........where the spacing becomes smaller as you get closer to shore. -% ...........In this case the grid is irregular but not curvilinear. -% .......Grid lines can be curved. That would be an irregular and curvilinear -% ...........grid. -% .......It is possible to specify a rotated regular grid in WW3 by treating -% ...........it as an irregular grid. (SWAN users may be familiar with the -% ..........."CGRID...alpc" variable which is another way to specify a -% ...........rotated regular grid) - -% theta-dimension is i -dtheta=0.4; -theta=180:(-1*dtheta):90; -theta=theta .* (pi/180); -ni=length(theta); - -% radial dimension is j -radius(1)=600000; -nj=331; - -% offset is arbitrary -xoffset=7e+6; -yoffset=2e+6; - -disp('calculating xgrd ygrd') - -for jj=1:nj - if jj > 1 - ds=dtheta*(pi/180)*radius(jj-1); % arc-length of cells - dr=ds; % make each cell roughly square - radius(jj)=radius(jj-1)+dr; - end - for ii=1:ni - xgrd(ii,jj)=radius(jj)*cos(theta(ii)); - ygrd(ii,jj)=radius(jj)*sin(theta(ii)); - end -end - -xgrd=xgrd+xoffset; -ygrd=ygrd+yoffset; - -disp('finished calculating xgrd ygrd') - -figure(1),clf,hold off - -subplot(2,2,1) -plot(xgrd,ygrd,'k.') -axis equal -axis([min(min(xgrd)) max(max(xgrd)) min(min(ygrd)) max(max(ygrd))]) -grid on - -subplot(2,2,2) -plot(xgrd,ygrd,'k.') -axis equal -axis([6220000 6460000 1980000 2220000]) -grid on - -subplot(2,2,3) -plot(xgrd,ygrd,'k.') -axis equal -axis([974000 1210000 1930000 2170000]) -grid on - -disp('saving grid') - -xgrd=xgrd'; -ygrd=ygrd'; - -save xgrd.2.1c.dat xgrd -ascii -save ygrd.2.1c.dat ygrd -ascii - -disp('finished saving grid') diff --git a/model/aux/profile.gs b/model/aux/profile.gs deleted file mode 100644 index 5a8d8d2a1..000000000 --- a/model/aux/profile.gs +++ /dev/null @@ -1,555 +0,0 @@ -* -* profile.gs : Visualize multi-scale wave model profiler info. -* ---------------------------------------------------------------- -* version 2: color of bw option added -* -* This GrADS scripts reads and displays information from the -* profile output from WAVEWATCH III as generated with the !/MPRF -* switch. ALl data is read from the files prf.NNN.mww3 -* -* General set up - - - - - - - - - - - - - - - - - - - - - - - - - -* - 'set display color white' - 'clear' -* -* Set up page - - - - - - - - - - - - - - - - - - - - - - - - - - -* - header = ' es' - legend = 'yes' -* - headf = 1 / 60 - subhf = 1 / 80 - axisf = 1 / 80 - legnf = 1 / 100 - bhmaxf = 3.0 * axisf -* -* Set up colors - - - - - - - - - - - - - - - - - - - - - - - - - -* -* 20: WMINIT -* 21: WMFINL -* 22: WMWAVE ST00 -* 23: WMWAVE ST01 -* 24: WMWAVE ST02 -* 25: WMWAVE ST04 -* 26: WMWAVE ST05 -* 27: WMWAVE ST06 -* 28: WMWAVE ST07 UPTS -* 29: WMWAVE BCST -* 31+ WMWAVE ST03 --> 30 + IMOD -* - 'set rgb 20 105 105 105' - 'set rgb 21 155 155 155' - 'set rgb 22 0 0 55' - 'set rgb 23 0 0 105' - 'set rgb 24 0 0 155' - 'set rgb 25 0 0 255' - 'set rgb 26 55 55 255' - 'set rgb 27 105 105 255' - 'set rgb 28 155 155 255' - 'set rgb 29 205 205 205' -* - 'set rgb 31 255 0 255' - 'set rgb 32 0 105 0' - 'set rgb 33 0 190 0' - 'set rgb 34 0 215 0' - 'set rgb 35 0 255 0' - 'set rgb 36 205 0 0' - 'set rgb 37 105 0 0' - 'set rgb 38 255 0 0' - 'set rgb 39 255 0 0' - 'set rgb 40 255 0 0' - 'set rgb 41 255 0 0' - 'set rgb 42 255 0 0' - 'set rgb 43 255 0 0' - 'set rgb 44 255 0 0' - 'set rgb 45 255 0 0' - 'set rgb 46 255 0 0' - 'set rgb 47 255 0 0' - 'set rgb 48 255 0 0' - 'set rgb 49 255 0 0' - 'set rgb 50 255 0 0' -* -* Get size of page - - - - - - - - - - - - - - - - - - - - - - - - -* - 'q gxinfo' - line = sublin(result,2) - xmax = subwrd(line,4) - ymax = subwrd(line,6) -* -* Current date and time - - - - - - - - - - - - - - - - - - - - - -* - gdate="yyyy/mm/dd" - '!date -u "+%Y/%m/%d" > tmp_grads_gdate' - result = read (tmp_grads_gdate) - gdate = sublin(result,2) - '!rm -f tmp_grads_gdate' -* -* Print initial info to screen - - - - - - - - - - - - - - - - - - -* - say ' ' - say '--------------------------' - say '*** Running profile.gs ***' - say '--------------------------' - say ' ' -* -* Number of profile files - - - - - - - - - - - - - - - - - - - - -* - '!rm -f tmp_grads_data tmp_grads_err' - '!ls prf.*.mww3 2> tmp_grads_err | wc -l > tmp_grads_data' - - result = read (tmp_grads_err) - line = sublin(result,2) - error = subwrd(line,1) - - if ( error = 'ls:' ) - say ' ' - say ' *** connot find profile data files ***' - say ' ' - 'quit' - endif - - result = read (tmp_grads_data) - line = sublin(result,2) - nproc = subwrd(line,1) - say 'Number of proceccors : ' nproc -* - i_min = 1 - i_max = nproc -* - '!rm -f tmp_grads_data tmp_grads_err' -* -* Min and max times - - - - - - - - - - - - - - - - - - - - - - - -* - - '!ls -l prf.*.mww3 | wc -l > tmp_grads_wc' - result = read (tmp_grads_wc) - line = sublin(result,2) - files = subwrd(line,1) - - if ( files = 1 ) - i1 = 1 - i2 = 2 - else - i1 = 2 - i2 = 3 - endif - - '!grep WMINIT prf.*.mww3 | sort -un -k ' i1 ' | head -1> tmp_grads_tmin' - result = read (tmp_grads_tmin) - line = sublin(result,2) - tmin = subwrd(line,i1) - - '!grep WMFINL prf.*.mww3 | sort -un -k ' i2 ' | tail -1> tmp_grads_tmax' - result = read (tmp_grads_tmax) - line = sublin(result,2) - tmax = subwrd(line,i2) - - say 'Time range : ' tmin ' - ' tmax - - '!rm -f tmp_grads_wc tmp_grads_tmin tmp_grads_tmax' -* -* Min and max times to plot - - - - - - - - - - - - - - - - - - - -* - tdmin = tmin - tdmax = tmax -* -* tdmin = 18.000 -* tdmax = 48.000 -* -* Set up page - - - - - - - - - - - - - - - - - - - - - - - - - - -* - xpmin = 0.75 - xpmax = xmax - 0.5 -* - head = headf * ( xpmax - xpmin ) - subh = subhf * ( xpmax - xpmin ) - axis = axisf * ( xpmax - xpmin ) - legn = legnf * ( xpmax - xpmin ) - bhmax = bhmaxf * ( xpmax - xpmin ) -* - ypmin = 1.5 - ypmax = ymax - 1.0 - dy = ( ypmax - ypmin ) / ( i_max - i_min + 1 ) - if ( dy > bhmax ) - dy = bhmax - endif - ypmin = ypmax - ( i_max - i_min + 1 ) * dy - xfac = ( xpmax - xpmin ) / ( tdmax - tdmin ) -* - 'draw rec ' xpmin ' ' ypmin ' ' xpmax ' ' ypmax -* - 'set font 1' -* -* header -* - if ( header = 'yes' ) - 'set string 1 c 3' - 'set strsiz ' head - xtc = 0.5 * ( xpmin + xpmax ) - ytc = ypmax + 2.5 * head - 'draw string ' xtc ' ' ytc ' MWW3 profiling info' - 'set strsiz ' subh - ytc = ypmax + 1. * head - 'draw string ' xtc ' ' ytc ' times from ' tdmin ' to ' tdmax - endif -* -* axes -* - 'set string 1 r 3' - 'set strsiz ' axis - 'set font 0' - xa = xpmin - 0.5 * axis - ya = ypmax - 0.5 * dy - ylast = ya - i = i_min - 'draw string ' xa ' ' ya ' ' i - i = i_min + 1 - while ( i <= i_max ) - ya = ya - dy - if ( ylast - ya > 2.5 * axis ) - 'draw string ' xa ' ' ya ' ' i - ylast = ya - endif - i = i + 1 - endwhile -* - 'set string 1 c 3 90' - 'set strsiz ' axis - 'set font 1' - xtc = xpmin - 5.5 * axis - ytc = 0.5 * ( ypmin + ypmax ) - 'draw string ' xtc ' ' ytc ' processor' - 'set string 1 c 3 0' -* - dtt = ( tdmax - tdmin ) / 8 - dttt = dtt - if ( dttt <= 1. ) - i = 0 - while ( dttt <= 1. ) - dttt = dttt * 10. - i = i + 1 - endwhile - '!echo ' dttt ' | sed "s/\./ /g" > tmp_grads_dt' - result = read (tmp_grads_dt) - line = sublin(result,2) - dt = subwrd(line,1) - while ( i > 0 ) - dt = dt / 10. - i = i - 1 - endwhile - else - i = 0 - while ( dttt >= 1. ) - dttt = dttt / 10. - i = i + 1 - endwhile - dttt = dttt * 10. - i = i - 1 - '!echo ' dttt ' | sed "s/\./ /g" > tmp_grads_dt' - result = read (tmp_grads_dt) - line = sublin(result,2) - dt = subwrd(line,1) - while ( i > 0 ) - dt = dt * 10. - i = i - 1 - endwhile - endif - '!rm -f tmp_grads_dt' -* - 'set string 1 c 3' - 'set strsiz ' axis - 'set font 1' - xtc = 0.5 * ( xpmin + xpmax ) - ytc = ypmin - 3.5 * axis - 'draw string ' xtc ' ' ytc ' time (s)' -* - nr_lev = ( tdmax - tdmin ) / dt - if ( nr_lev > 12 ) - dt = dt * 2 - endif - if ( nr_lev < 6 ) - dt = dt / 2 - endif -* - 'set string 1 c 3' - 'set line 1 1 5' - xa = xpmin - 0.5 * axis - ya = ypmin - 1.5 * axis - yl = ypmin - 0.25 * axis - 'set font 0' - t = 0 - while ( t < tdmax ) - if ( t >= tdmin ) - xa = xpmin + xfac * ( t - tdmin ) - 'draw line ' xa ' ' ypmin ' ' xa ' ' yl - 'draw string ' xa ' ' ya ' ' t - endif - t = t + dt - endwhile -* - say ' ' -* -* Loop over data files - - - - - - - - - - - - - - - - - - - - - - -* - '!ls prf.*.mww3 > tmp_grads_files' - i = i_min - mmx = 0 - while ( i <= i_max ) - result = read (tmp_grads_files) - file = subwrd(result,2) -* - yh = ypmax - (i-1) * dy - yl = ypmax - i * dy -* -* Loop over data in file - - - - - - - - - - - - - - - - - - - - - -* - OK = 0 - j = 0 - jj = 1 -* - while ( OK = 0 ) -* - result = read (file) - line = sublin(result,1) - OK = subwrd(result,1) - if ( OK = 0 ) - line = sublin(result,2) - t1 = subwrd(line,1) - t2 = subwrd(line,2) - ID = subwrd(line,4) - if ( ID = 'WMWAVE' ) - ID2 = subwrd(line,5) - if ( ID2 = 'TIME' ) - ttime.jj.i = t1 - jj = jj + 1 - endif - if ( ID2 = 'ST03' ) - imod = subwrd(line,6) - if ( imod > mmx ) - mmx = imod - endif - endif - endif -* -* Check time range, convert to plot -* - if ( t1 < tdmax & t2 > tdmin ) -* - if ( t1 < tdmin ) - tl = tdmin - else - tl = t1 - endif - if ( t2 > tdmax ) - tr = tdmax - else - tr = t2 - endif -* - xl = xpmin + xfac * ( tl - tdmin ) - xr = xpmin + xfac * ( tr - tdmin ) -* -* Case WMINIT -* - if ( ID = 'WMINIT' ) - 'set line 20' - 'draw recf ' xl ' ' yl ' ' xr ' ' yh - endif -* -* Case WMWAVE -* - if ( ID = 'WMWAVE' ) - if ( t1 != t2 ) - lcol = -1 - if ( ID2 = 'ST00' ) - lcol = 22 - endif - if ( ID2 = 'ST01' ) - lcol = 23 - endif - if ( ID2 = 'ST02' ) - lcol = 24 - endif - if ( ID2 = 'ST03' ) - lcol = 30 + imod - endif - if ( ID2 = 'ST04' ) - lcol = 25 - endif - if ( ID2 = 'ST05' ) - lcol = 26 - endif - if ( ID2 = 'ST06' ) - lcol = 27 - endif - if ( ID2 = 'ST07' ) - lcol = 28 - endif - if ( ID2 = 'UPTS' ) - lcol = 28 - endif - if ( ID2 = 'BCST' ) - lcol = 29 - endif - if ( lcol > 0 ) - 'set line ' lcol - 'draw recf ' xl ' ' yl ' ' xr ' ' yh - endif - endif - endif -* -* Case WMFINL -* - if ( ID = 'WMFINL' ) - 'set line 21' - if ( t1 != t2 ) - 'draw recf ' xl ' ' yl ' ' xr ' ' yh - else - 'draw line ' xl ' ' yl ' ' xr ' ' yh - endif - endif -* - endif -* - j = j + 1 - else - say 'file ' file ' : ' j ' data read' - endif -* - endwhile -* - i = i + 1 - endwhile -* - '!rm -f tmp_grads_tmin tmp_grads_files' -* -* time step lines -* - 'set line 1 1 5' - j = 1 - xl = -1. - while ( j < jj ) - i = i_min - while ( i <= i_max ) - xlast = xl - xl = xpmin + xfac * ( ttime.j.i - tdmin ) - yh = ypmax - (i-1) * dy - yl = ypmax - i * dy - if ( xl > xpmin & xl < xpmax ) - 'draw line ' xl ' ' yl ' ' xl ' ' yh - endif - if ( i > 1 ) - if ( xlast < xl ) - xhl = xlast - xhr = xl - else - xhl = xl - xhr = xlast - endif - if ( xhl < xpmax & xhr > xpmin ) - if ( xhl < xpmin) - xhl = xpmin - endif - if ( xhr > xpmax) - xhr = xpmax - endif - 'draw line ' xhl ' ' yh ' ' xhr ' ' yh - endif - endif - i = i + 1 - endwhile - j = j + 1 - endwhile -* - 'set line 1 1 10' - 'draw rec ' xpmin ' ' ypmin ' ' xpmax ' ' ypmax -* -* legend -* - if ( legend = 'yes' ) -* - boxs = 10 + mmx - bscale = boxs / 20 - if ( bscale > 0.9 ) - bscale = 0.9 - endif - bsep = ( xpmax - xpmin ) / boxs * bscale - bwdt = 0.5 * bsep -* if ( bwdt > 0.75 * dy ) -* bwdt = 0.75 * dy -* bsep = 2 * bwdt -* endif -* - xl = 0.5 * ( xpmax + xpmin ) - ( boxs / 2 * bsep ) + ( 0.5 * bsep ) - yt = ypmin - 5.5 * axis - yb = yt - 1.0 * legn - 0.5 * bwdt -* - 'set string 1 c 3' - 'set strsiz ' legn - 'set font 1' - i = 1 - while ( i <= boxs ) - if ( i = 1 ) - bID = 'ini' - endif - if ( i = 2 ) - bID = 'fnl' - endif - if ( i = 3 ) - bID = 'inp' - endif - if ( i = 4 ) - bID = 'low' - endif - if ( i = 5 ) - bID = 'tme' - endif - if ( i = 6 ) - bID = 'eql' - endif - if ( i = 7 ) - bID = 'hgh' - endif - if ( i = 8 ) - bID = 'das' - endif - if ( i = 9 ) - bID = 'out' - endif - if ( i = 10 ) - bID = 'bct' - endif - if ( i > 10 ) - bID = 'm' i-10 - endif - 'draw string ' xl ' ' yt ' ' bID -* - if ( i <= 10 ) - icol = 19 + i - else - icol = 20 + i - endif - 'set line ' icol - ' draw recf ' xl-0.5*bwdt ' ' yb-0.5*bwdt ' ' xl+0.5*bwdt ' ' yb+0.5*bwdt - 'set line 1 1 3' - ' draw rec ' xl-0.5*bwdt ' ' yb-0.5*bwdt ' ' xl+0.5*bwdt ' ' yb+0.5*bwdt -* - i = i + 1 - xl = xl + bsep - endwhile -* - endif -* -* End of operations - - - - - - - - - - - - - - - - - - - - - - - -* - 'printim ww3_profile.png' -* - say ' ' - say '-------------------------' - say '*** End of profile.gs ***' - say '-------------------------' - say ' ' -* - 'quit' -* -* End of profile.gs - - - - - - - - - - - - - - - - - - - - - - - diff --git a/model/aux/source.gs b/model/aux/source.gs deleted file mode 100644 index bbb369b13..000000000 --- a/model/aux/source.gs +++ /dev/null @@ -1,1150 +0,0 @@ -* -* source.gs : GrADS plots of wave spectrum and sources -* ---------------------------------------------------------------- -* version 2: grid options now in one script -* color of bw option added -* polar / Cartesian option added -* -* This is a generic grads scripts that runs without modifications -* for arbitary numbers of output locations and times. For each -* and location a five-panel plot is produced. -* -* Scripts and files used : -* colorset.gs : Sets up shading colors -* spec_ids : Grid and center ID's, defaults if not given -* ww3.spec.grads : GrADS data file. -* ww3.spec.ctl : GrADS control file. -* ww3.mean.grads : Suplemental GrAds data file. -* -* The files ww3.* are generated automatically by gx_outp -* (WAVEWATCH postprocessor). -* -* *** NOTE it is expected that gx_outp produces spectra at -* level = 1 and all available source terms. -* This is not checked internally -* *** NOTE it is expected that the point name does not contains -* spaces, othewise mean parameters will be clobbered -* -* General set up - - - - - - - - - - - - - - - - - - - - - - - - - -* - display=white -* -* llgrd : long-lat grid [yes/---] -* color : color or b&w [yes/---] -* polar : polar repres. [yes/---] -* - llgrd = ' es' - color = 'yes' - polar = 'yes' -* - if ( polar = 'yes' ) -* -* dth : grid directional increment for polar plot -* dfr : grid frequency increment for polar plot -* fmx : maximum frequency in polar plot -* - dth = 15 - dfr = 0.05 - fmx = 0.25 - else -* -* thoff : direction at bottom of plot -* dth : grid directional increment for Cartesian plot -* dfr : grid frequency increment for Cartesian plot -* fmn : maximum frequency in Cartesian plot -* fmx : minimum frequency in Cartesian plot -* - thoff = -180. - dth = 45. - dfr = 0.05 - fmn = 0.0412 - fmx = 0.4056 - endif -* - 'set display color ' display - 'clear' - 'run colorset.gs' -* -* ID strings from file - - - - - - - - - - - - - - - - - - - - - - -* - result = read (spec_ids) - OK = sublin(result,1) - if ( OK = '0' ) - grid_ID = sublin(result,2) - else - grid_ID = 'unidentified grid' - endif -* - result = read (spec_ids) - OK = sublin(result,1) - if ( OK = '0' ) - center_ID = sublin(result,2) ', ' - else - center_ID = '' - endif -* -* Current date and time - - - - - - - - - - - - - - - - - - - - - -* - gdate="yyyy/mm/dd" - '!date -u "+%Y/%m/%d" > tmp_grads_gdate' - result = read (tmp_grads_gdate) - gdate = sublin(result,2) - '!rm -f tmp_grads_gdate' -* - center_ID = center_ID gdate -* -* Get size of page - - - - - - - - - - - - - - - - - - - - - - - - -* - 'q gxinfo' - line = sublin(result,2) - xmax = subwrd(line,4) - ymax = subwrd(line,6) -* -* Print initial info to screen - - - - - - - - - - - - - - - - - - -* - say ' ' - say '-------------------------' - say '*** Running source.gs ***' - say '-------------------------' - say ' ' - say 'Grid ID : ' grid_ID - say 'Center ID : ' center_ID - say 'Page : ' xmax ' by ' ymax -* -* Open data file - - - - - - - - - - - - - - - - - - - - - - - - - -* - 'open ww3.spec' -* -* Get some info for file - - - - - - - - - - - - - - - - - - - - - -* - 'q file 1' - line = sublin(result,5) - ntime = subwrd(line,12) - line = sublin(result,6) - nloc = subwrd(line,5) -* - say 'Nr. of times : ' ntime - say 'Nr. of loc. : ' nloc -* - iloc = 1 - while ( iloc <= nloc ) - iline = 6 + iloc - line = sublin(result,iline) - par_ID.iloc = subwrd(line,1) - loc_ID.iloc = substr(line,21,10) - say ' location ' iloc ' is called ' loc_ID.iloc ' and stored as ' par_ID.iloc - iloc = iloc + 1 - endwhile -* -* loop over time and location to get mean pars and max - - - - - - -* - say ' ' - say 'Reading mean data and getting maximum spectral density ...' - 'set gxout stat' -* - fmin = 1.e20 - fmax = -1.e20 - smin = 1.e20 - smax = -1.e20 -* - itime = 1 - while ( itime <= ntime ) -* - 'set t ' itime - say ' processing time ' showtime(itime) -* - iloc = 1 - while ( iloc <= nloc ) -* - result = read (ww3.mean.grads) - line = sublin(result,2) - lo.iloc.itime = subwrd(line,2) - la.iloc.itime = subwrd(line,3) - de.iloc.itime = subwrd(line,4) - ua.iloc.itime = subwrd(line,5) - ux.iloc.itime = subwrd(line,6) - uy.iloc.itime = subwrd(line,7) - ca.iloc.itime = subwrd(line,9) - cx.iloc.itime = subwrd(line,10) - cy.iloc.itime = subwrd(line,11) - hs.iloc.itime = subwrd(line,12) -* -* say result -* say iloc ' ' itime ' ' hs.iloc.itime -* say ua.iloc.itime ' ' ux.iloc.itime ' ' uy.iloc.itime -* say ca.iloc.itime ' ' cx.iloc.itime ' ' cy.iloc.itime -* - 'set lev 1' - 'd ' par_ID.iloc - line = sublin(result,8) - lmin = subwrd(line,4) - lmax = subwrd(line,5) - if ( lmin < fmin) ; fmin = lmin ; endif - if ( lmax > fmax) ; fmax = lmax ; endif -* - ilev = 2 - while ( ilev <= 6 ) - 'set lev ' ilev - 'd ' par_ID.iloc - line = sublin(result,8) - lmin = subwrd(line,4) - lmax = subwrd(line,5) - if ( lmin < smin) ; smin = lmin ; endif - if ( lmax > smax) ; smax = lmax ; endif - ilev = ilev + 1 - endwhile -* -* say result -* say fmin ' ' fmax ' ' lmin ' ' lmax -* - iloc = iloc + 1 -* - endwhile -* - itime = itime + 1 -* - endwhile -* - if ( -smin > smax ) - sscl = -smin - else - sscl = smax - endif - - say ' ' - say 'Done, min and max for spectrum are ' fmin ' and ' fmax - say ' min and max for sources are ' smin ' and ' smax ' (' sscl ')' -* -* Generic page setup - - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say 'Setting up the page ...' -* - st1 = '' - st2 = '' - st3 = '' - st4 = '' -* -* settings for 6 panel ... -* - xtc = 0.5 * xmax - yt1 = 10.7 - yt2 = 0.2 - yt3 = 0.4 - size1 = 0.20 - size2 = 0.12 - size3 = 0.12 - size4 = 0.12 - nc = 30 -* - pw = 3.0 - sx = 0.2 - sy = 0.3 - xp0 = 0.5 * ( xmax - sx ) - pw - yp0 = 7.25 -* - xt1 = xtc - pw - xt2 = xtc - pw + 12*size4 - xt3 = 0.5 * ( xt2 + xtc ) - ytl0 = yp0 - pw - sy - 0.3*pw -* -* Actual plotting loop - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say 'Starting actual plotting ...' -* - ipage = 0 -* - i = 1 - while ( i <= ntime ) - 'set t ' i -* - j = 1 - while ( j <= nloc ) -* -* ... new page ... -* - ipage = ipage + 1 - say ' Starting with page ' ipage -* - if ( ipage > 1 ) - iplot = ipage - 1 - 'printim sterms_plot_'iplot'.png' - 'clear' - endif -* - page_ID = loc_ID.j ' at ' showtime(i) -* - 'set string 1 c 5' - 'set strsiz ' size1 - 'draw string ' xtc ' ' yt1 ' ' page_ID - 'set strsiz ' size2 - 'draw string ' xtc ' ' yt2 ' ' grid_ID - 'set strsiz ' size3 - 'draw string ' xtc ' ' yt3 ' ' center_ID -* - 'set string 1 l 5' - 'set strsiz ' size4 - ytl = ytl0 - if ( llgrd = 'yes' ) - 'draw string ' xt1 ' ' ytl ' Location' - else - 'draw string ' xt1 ' ' ytl ' Location (km)' - endif - 'set string 1 c 5' - 'draw string ' xt2 ' ' ytl ' :' - if ( llgrd = 'yes' ) - if ( la.j.i >= 0 ) - lat = la.j.i - loc = lat 'N ' - else - lat = - la.j.i - loc = lat 'S ' - endif - if ( lo.j.i > 180 ) - lon = 360 - lo.j.i - loc = loc lon 'W' - else - lon = lo.j.i - loc = loc lon 'E' - endif - else - loc = lo.j.i '-' la.j.i - endif -* - 'draw string ' xt3 ' ' ytl ' ' loc -* - 'set string 1 l 5' - ytl = ytl - 2.0 * size4 - 'draw string ' xt1 ' ' ytl ' Depth' - 'set string 1 c 5' - 'draw string ' xt2 ' ' ytl ' :' - 'draw string ' xt3 ' ' ytl ' ' de.j.i ' m' -* - 'set string 1 l 5' - ytl = ytl - 2.0 * size4 - 'draw string ' xt1 ' ' ytl ' Wind speed' - 'set string 1 c 5' - 'draw string ' xt2 ' ' ytl ' :' - 'draw string ' xt3 ' ' ytl ' ' ua.j.i ' m/s' -* - ytl = ytl - 2.0 * size4 - 'set string 1 l 5' - 'draw string ' xt1 ' ' ytl ' Current vel.' - 'set string 1 c 5' - 'draw string ' xt2 ' ' ytl ' :' - 'draw string ' xt3 ' ' ytl ' ' ca.j.i ' m/s' -* - ytl = ytl - 2.0 * size4 - 'set string 1 l 5' - 'draw string ' xt1 ' ' ytl ' Wave height' - 'set string 1 c 5' - 'draw string ' xt2 ' ' ytl ' :' - 'draw string ' xt3 ' ' ytl ' ' hs.j.i ' m' -* -* ... plot spectrum ... -* - 'set lev 1' - st1 = 'spectrum' - xp = xp0 - yp = yp0 -* - if ( polar = 'yes' ) - dummy = plotspec (xp,yp,pw,dth,dfr,fmx,par_ID.j,fmax,st1,st2,st3,st4,nc,ua.j.i,ux.j.i,uy.j.i,ca.j.i,cx.j.i,cy.j.i,color) - else - dummy = plotspec_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,fmax,st1,st2,st3,st4,nc,ua.j.i,ux.j.i,uy.j.i,ca.j.i,cx.j.i,cy.j.i,color) - endif -* -* ... plot input ... -* - 'set lev 2' - st1 = 'wind source term' - xp = xp0 + pw + sx - yp = yp0 -* - if ( polar = 'yes' ) - dummy = plotsrce (xp,yp,pw,dth,dfr,fmx,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - else - dummy = plotsrce_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - endif -* -* ... plot interactions ... -* - 'set lev 3' - st1 = 'nonlinear interations' - xp = xp0 + pw + sx - yp = yp0 - pw - sy -* - if ( polar = 'yes' ) - dummy = plotsrce (xp,yp,pw,dth,dfr,fmx,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - else - dummy = plotsrce_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - endif -* -* ... plot dissipation ... -* - 'define diss = ' par_ID.j'(z=4) + ' par_ID.j'(z=5)' - st1 = 'dissipation source term' - xp = xp0 + pw + sx - yp = yp0 - 2*pw - 2*sy -* - if ( polar = 'yes' ) - dummy = plotsrce (xp,yp,pw,dth,dfr,fmx,diss,sscl,st1,st2,st3,st4,nc,color) - else - dummy = plotsrce_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,diss,sscl,st1,st2,st3,st4,nc,color) - endif -* -* ... plot total source term ... -* - 'set lev 6' - st1 = 'total source term' - xp = xp0 - yp = yp0 - pw - sy -* - if ( polar = 'yes' ) - dummy = plotsrce (xp,yp,pw,dth,dfr,fmx,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - else - dummy = plotsrce_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,sscl,st1,st2,st3,st4,nc,color) - endif -* - j = j + 1 - endwhile -* - i = i + 1 - endwhile -* -* End of operations - - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say '------------------------' - say '*** End of source.gs ***' - say '------------------------' - say ' ' -* - 'quit' -* -* End of main script - - - - - - - - - - - - - - - - - - - - - - - - -* ------------------------------------------------------------------------------ - function plotspec (xp0,yp0,dxyp,dxgrid,dygrid,ymax,spec,scale,str1,str2,str3,str4,strlen,u,ux,uy,c,cx,cy,color) -* -* Function to plot a spectrum at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* dxgrid Grid line increment for directions. -* dygrid Grid line increment for frequencies. -* ymax Maximum frequency. -* spec Spectrum to be plotted. -* scale Scale (division) factor for spectrum. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* ux/y Wind speed and components. -* cx/y Current speed and components. -* color color of b&w [yes/---] -* -* 0. Initializations -* - 'set grads off' - 'set lon -180 180' - 'set lat ' 90-ymax ' 90' -* -* 1. Set up plot location -* - 'set parea ' xp0 ' ' xp0+dxyp ' ' yp0 ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 15 - factor = 2 - level=1.001 - levels='' -* - while ( i > 0 ) - level = level / factor - levels = level ' ' levels - i = i - 1 - endwhile -* -* 3. Plot spectrum -* - 'set mproj nps' - 'set grid off' -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' - 'd ' spec'/'scale - cblack = 1 - current = 65 - wind = 64 - else - cblack = 3 - current = 66 - wind = 63 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set clevs ' levels - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 4. Plot grid lines manually to avoid bug -* - if ( color = 'yes' ) - 'set line 66 5 2' - else - 'set line 66 1 3' - endif -* - x = 0 - while ( x < 360+0.1*dxgrid ) - 'q ll2xy 'x' '90.-dygrid - x1 = subwrd(result,1) - y1 = subwrd(result,2) - 'q ll2xy 'x' '90.-ymax - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - x = x + dxgrid - endwhile -* - dx = 5 - y = dygrid - while ( y < ymax + 0.1*dygrid ) - x = 0 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - while ( x < 360 ) - x = x+dx - x1 = x2 - y1 = y2 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - endwhile - y = y + dygrid - endwhile -* - 'set gxout contour' - 'set cthick ' cblack - 'set clevs ' levels - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 5. Plot current and wind vector -* - xc = xp0 + 0.5*dxyp - yc = yp0 + 0.5*dxyp -* -* 5.a current -* - 'set line ' current ' 1 6' -* - cmax = 1.5 - cmin = 0.1 - if ( c > cmin ) - if ( c < cmax ) - dc = 0.375 * (dygrid/ymax) * dxyp * c / cmax - else - dc = 0.375 * (dygrid/ymax) * dxyp - endif - dcx = dc * cx / c - dcy = dc * cy / c - x2 = xc - dcx - y2 = yc - dcy - x1 = xc + dcx - y1 = yc + dcy -* -* 'draw line ' x2 ' ' y2 ' ' x1 ' ' y1 -* - 'q xy2w 'x1' 'y1 - lon = subwrd(result,3) - lat = subwrd(result,6) - lonh = lon + 10 - lath = 90. - 0.75*(90.-lat) - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 - lonh = lon - 10 - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 -* - endif -* -* 5.b wind -* - 'set line ' wind ' 1 6' -* - umax = 20. - umin = 2.5 - if ( u > umin ) - if ( u < umax ) - du = 0.375 * (dygrid/ymax) * dxyp * u / umax - else - du = 0.375 * (dygrid/ymax) * dxyp - endif - dux = du * ux / u - duy = du * uy / u - x2 = xc - dux - y2 = yc - duy - x1 = xc + dux - y1 = yc + duy -* - 'draw line ' x2 ' ' y2 ' ' x1 ' ' y1 -* - 'q xy2w 'x1' 'y1 - lon = subwrd(result,3) - lat = subwrd(result,6) - lonh = lon + 10 - lath = 90. - 0.75*(90.-lat) - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 - lonh = lon - 10 - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 -* - endif -* -* 6. ID text around spectrum -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0 ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0 ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function plotsrce (xp0,yp0,dxyp,dxgrid,dygrid,ymax,source,scale,str1,str2,str3,str4,strlen,color) -* -* Function to plot a source term at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* dxgrid Grid line increment for directions. -* dygrid Grid line increment for frequencies. -* ymax Maximum frequency. -* source Source term to be plotted. -* scale Scale (division) factor for source term. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* color color of b&w [yes/---] -* -* 0. Initializations -* - 'set grads off' - 'set lon -180 180' - 'set lat ' 90-ymax ' 90' -* -* 1. Set up plot location -* - 'set parea ' xp0 ' ' xp0+dxyp ' ' yp0 ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 7 - factor = 2 - levelp = 1.001 - leveln = -1.001 - levpos = '' - levneg = '' -* - while ( i > 0 ) - levelp = levelp / factor - leveln = leveln / factor - levpos = levelp ' ' levpos - levneg = levneg ' ' leveln - i = i - 1 - endwhile - levels = levneg ' 0 ' levpos -* -* 3. Plot source term -* - 'set mproj nps' - 'set grid off' -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56' -* 'set ccols 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41' - 'd ' source'/'scale - cblack = 1 - stpos = 1 - stneg = 1 - else - cblack = 3 - stpos = 1 - stneg = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stpos - 'set clevs ' levpos - 'd ' source'/'scale -* -* 4. Plot grid lines manually to avoid bug -* - if ( color = 'yes' ) - 'set line 60 5 2' - else - 'set line 66 1 3' - endif -* - x = 0 - while ( x < 360+0.1*dxgrid ) - 'q ll2xy 'x' '90.-dygrid - x1 = subwrd(result,1) - y1 = subwrd(result,2) - 'q ll2xy 'x' '90.-ymax - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - x = x + dxgrid - endwhile -* - dx = 5 - y = dygrid - while ( y < ymax + 0.1*dygrid ) - x = 0 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - while ( x < 360 ) - x = x+dx - x1 = x2 - y1 = y2 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - endwhile - y = y + dygrid - endwhile -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stpos - 'set clevs ' levpos - 'd ' source'/'scale - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stneg - 'set clevs ' levneg - 'd ' source'/'scale -* -* 5. ID text around source term -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0 ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0 ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function plotspec_c (xp0,yp0,dxyp,xoff,dx,ymin,ymax,dy,spec,scale,str1,str2,str3,str4,strlen,u,ux,uy,c,cx,cy,color) -* -* Function to plot a spectrum at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* xoff Shift of first frequency (if 0, axis from 0-360 cartesian) -* dx Directional increment (axis). -* ymin Minimum frequency. -* ymax Maximum frequency. -* dy Frequency increment (axis). -* spec Spectrum to be plotted. -* scale Scale (division) factor for spectrum. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* ux/y Wind speed and components. -* cx/y Current speed and components. -* -* 0. Initializations -* - 'set grads off' - 'set lon ' xoff-270 ' ' xoff+90 - 'set lat ' 90-ymax ' ' 90-ymin -* -* 1. Set up plot location -* - 'set parea ' xp0+0.07*dxyp ' ' xp0+dxyp ' ' yp0+0.05*dxyp ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 15 - factor = 2 - level=1.001 - levels='' -* - while ( i > 0 ) - level = level / factor - levels = level ' ' levels - i = i - 1 - endwhile -* -* 3. Plot spectrum -* - 'set mproj scaled' - 'set xyrev on' - 'set xflip on' - 'set grid off' - 'set xlab off' - 'set ylab off' - labsize = dxyp / strlen / 1.25 - 'set ylopts 1 4 ' labsize - 'set ylint ' dx - 'set xlint ' dy -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' - 'd ' spec'/'scale - cblack = 1 - else - cblack = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 4. Plot axes manually -* - freq = 0. - 'set line 1 1 4' - 'set string 1 c 4' - 'set strsiz ' labsize -* - while ( freq <= ymax ) - if ( freq >= ymin ) - xt = xp0 + 0.07*dxyp + 0.93*dxyp * ( freq - ymin ) / ( ymax - ymin ) - 'draw line ' xt ' ' yp0+1.5*labsize ' ' xt ' ' yp0 + 0.05*dxyp - 'draw string ' xt ' ' yp0+0.5*labsize ' ' freq - endif - freq = freq + dy - endwhile -* - thmin = xoff - thmax = xoff + 360. - th = 0. -* - while ( th > thmin ) - th = th - dx - endwhile -* - 'set string 1 r 4' - while ( th <= thmax ) - if ( th >= thmin ) - yt = yp0 + 0.05*dxyp + 0.95*dxyp * ( th - thmin ) / ( thmax - thmin ) - 'draw line ' xp0+0.07*dxyp ' ' yt ' ' xp0+0.07*dxyp-0.5*labsize ' ' yt - 'draw string ' xp0+0.07*dxyp-1.0*labsize ' ' yt ' ' th - endif - th = th + dx - endwhile -* -* 5. Plot current and wind vector -* -* -* 6. ID text around spectrum -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function plotsrce_c (xp0,yp0,dxyp,xoff,dx,ymin,ymax,dy,source,scale,str1,str2,str3,str4,strlen,color) -* -* Function to plot a source term at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* xoff Shift of first frequency (if 0, axis from 0-360 cartesian) -* dx Directional increment (axis). -* ymin Minimum frequency. -* ymax Maximum frequency. -* dy Frequency increment (axis). -* source Source term to be plotted. -* scale Scale (division) factor for source term. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* -* 0. Initializations -* - 'set grads off' - 'set lon ' xoff-270 ' ' xoff+90 - 'set lat ' 90-ymax ' ' 90-ymin -* -* 1. Set up plot location -* - 'set parea ' xp0+0.07*dxyp ' ' xp0+dxyp ' ' yp0+0.05*dxyp ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 7 - factor = 2 - levelp = 1.001 - leveln = -1.001 - levpos = '' - levneg = '' -* - while ( i > 0 ) - levelp = levelp / factor - leveln = leveln / factor - levpos = levelp ' ' levpos - levneg = levneg ' ' leveln - i = i - 1 - endwhile - levels = levneg ' 0 ' levpos -* -* 3. Plot source term -* - 'set mproj scaled' - 'set xyrev on' - 'set xflip on' - 'set grid off' - 'set xlab off' - 'set ylab off' - labsize = dxyp / strlen / 1.25 - 'set ylopts 1 4 ' labsize - 'set ylint ' dx - 'set xlint ' dy -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56' -* 'set ccols 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41' - 'd ' source'/'scale - cblack = 1 - stpos = 1 - stneg = 1 - else - cblack = 3 - stpos = 1 - stneg = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stpos - 'set clevs ' levpos - 'd ' source'/'scale - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set cstyle ' stneg - 'set clevs ' levneg - 'd ' source'/'scale -* -* 4. Plot axes manually -* - freq = 0. - 'set line 1 1 4' - 'set string 1 c 4' - 'set strsiz ' labsize -* - while ( freq <= ymax ) - if ( freq >= ymin ) - xt = xp0 + 0.07*dxyp + 0.93*dxyp * ( freq - ymin ) / ( ymax - ymin ) - 'draw line ' xt ' ' yp0+1.5*labsize ' ' xt ' ' yp0 + 0.05*dxyp - 'draw string ' xt ' ' yp0+0.5*labsize ' ' freq - endif - freq = freq + dy - endwhile -* - thmin = xoff - thmax = xoff + 360. - th = 0. -* - while ( th > thmin ) - th = th - dx - endwhile -* - 'set string 1 r 4' - while ( th <= thmax ) - if ( th >= thmin ) - yt = yp0 + 0.05*dxyp + 0.95*dxyp * ( th - thmin ) / ( thmax - thmin ) - 'draw line ' xp0+0.07*dxyp ' ' yt ' ' xp0+0.07*dxyp-0.5*labsize ' ' yt - 'draw string ' xp0+0.07*dxyp-1.0*labsize ' ' yt ' ' th - endif - th = th + dx - endwhile -* -* 5. ID text around source term -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function showtime (itime) -* -* Get date and time in preferred format -* -* Parameter list : -* -* itime Discrete time counter -* - 'set t ' itime - 'query time' - gradsdate = subwrd(result,3) - test = substr ( gradsdate, 3, 1 ) - if ( test='Z' ) - year = substr ( gradsdate, 9, 4 ) - mnth = substr ( gradsdate, 6, 3 ) - day = substr ( gradsdate, 4, 2 ) - hour = substr ( gradsdate, 1, 2 ) - min = '00' - else - year = substr ( gradsdate, 12, 4 ) - mnth = substr ( gradsdate, 9, 3 ) - day = substr ( gradsdate, 7, 2 ) - hour = substr ( gradsdate, 1, 2 ) - min = substr ( gradsdate, 4, 2 ) - endif - - month= '??' - if (mnth='JAN'); month= '01'; endif; - if (mnth='FEB'); month= '02'; endif; - if (mnth='MAR'); month= '03'; endif; - if (mnth='APR'); month= '04'; endif; - if (mnth='MAY'); month= '05'; endif; - if (mnth='JUN'); month= '06'; endif; - if (mnth='JUL'); month= '07'; endif; - if (mnth='AUG'); month= '08'; endif; - if (mnth='SEP'); month= '09'; endif; - if (mnth='OCT'); month= '10'; endif; - if (mnth='NOV'); month= '11'; endif; - if (mnth='DEC'); month= '12'; endif; - - if ( test='Z' ) - vdate = year '/' month '/' day ' ' hour 'z' - else - vdate = year '/' month '/' day ' ' hour ':' min 'z' - endif -* - return vdate diff --git a/model/aux/spec.gs b/model/aux/spec.gs deleted file mode 100644 index 2efac30a5..000000000 --- a/model/aux/spec.gs +++ /dev/null @@ -1,825 +0,0 @@ -* -* spec.gs : GrADS plots of wave spectra -* ---------------------------------------------------------------- -* version 2: color of bw option added -* -* This is a generic grads scripts that runs without modifications -* for arbitary numbers of output locations and times. If one plot -* is asked for, a page filling spectrum is plotted. If more are -* asked for, spectral are grouped per time, with 4 or six plots -* on the page. -* -* Scripts and files used : -* colorset.gs : Sets up shading colors -* spec_ids : Grid and center ID's, defaults if not given -* ww3.spec.grads : GrADS data file. -* ww3.spec.ctl : GrADS control file. -* ww3.mean.grads : Suplemental GrAds data file. -* -* The files ww3.* are generated automatically by gx_outp -* (WAVEWATCH postprocessor). -* -* *** NOTE it is expected that gx_outp produces spectra at -* level = 1, this is not checked internally -* *** NOTE it is expected that the point name does not contains -* spaces, othewise mean parameters will be clobbered -* -* General set up - - - - - - - - - - - - - - - - - - - - - - - - - -* - display=white -* -* color : color or b&w [yes/---] -* polar : polar repres. [yes/---] -* - color = 'yes' - polar = 'yes' -* - if ( polar = 'yes' ) -* -* dth : grid directional increment for polar plot -* dfr : grid frequency increment for polar plot -* fmx : maximum frequency in polar plot -* - dth = 15 - dfr = 0.05 - fmx = 0.25 - else -* -* thoff : direction at bottom of plot -* dth : grid directional increment for Cartesian plot -* dfr : grid frequency increment for Cartesian plot -* fmn : maximum frequency in Cartesian plot -* fmx : minimum frequency in Cartesian plot -* - thoff = -180. - dth = 45. - dfr = 0.05 - fmn = 0.0412 - fmx = 0.4056 -* fmn = 0.04 -* fmx = 0.25 - endif - -* - 'set display color ' display - 'clear' - 'run colorset.gs' -* -* ID strings from file - - - - - - - - - - - - - - - - - - - - - - -* - result = read (spec_ids) - OK = sublin(result,1) - if ( OK = '0' ) - grid_ID = sublin(result,2) - else - grid_ID = 'unidentified grid' - endif -* - result = read (spec_ids) - OK = sublin(result,1) - if ( OK = '0' ) - center_ID = sublin(result,2) ', ' - else - center_ID = '' - endif -* -* Current date and time - - - - - - - - - - - - - - - - - - - - - -* - gdate="yyyy/mm/dd" - '!date -u "+%Y/%m/%d" > tmp_grads_gdate' - result = read (tmp_grads_gdate) - gdate = sublin(result,2) - '!rm -f tmp_grads_gdate' -* - center_ID = center_ID gdate -* -* Get size of page - - - - - - - - - - - - - - - - - - - - - - - - -* - 'q gxinfo' - line = sublin(result,2) - xmax = subwrd(line,4) - ymax = subwrd(line,6) -* -* Print initial info to screen - - - - - - - - - - - - - - - - - - -* - say ' ' - say '-----------------------' - say '*** Running spec.gs ***' - say '-----------------------' - say ' ' - say 'Grid ID : ' grid_ID - say 'Center ID : ' center_ID - say 'Page : ' xmax ' by ' ymax -* -* Open data file - - - - - - - - - - - - - - - - - - - - - - - - - -* - 'open ww3.spec' -* -* Get some info for file - - - - - - - - - - - - - - - - - - - - - -* - 'q file 1' - line = sublin(result,5) - ntime = subwrd(line,12) - line = sublin(result,6) - nloc = subwrd(line,5) -* - say 'Nr. of times : ' ntime - say 'Nr. of loc. : ' nloc -* - iloc = 1 - while ( iloc <= nloc ) - iline = 6 + iloc - line = sublin(result,iline) - par_ID.iloc = subwrd(line,1) - loc_ID.iloc = substr(line,21,10) - say ' location ' iloc ' is called ' loc_ID.iloc ' and stored as ' par_ID.iloc - iloc = iloc + 1 - endwhile -* -* loop over time and location to get mean pars and max - - - - - - -* - say ' ' - say 'Reading mean data and getting maximum spectral density ...' - 'set gxout stat' -* - fmin = 1.e20 - fmax = -1.e20 - 'set lev 1' -* - itime = 1 - while ( itime <= ntime ) -* - 'set t ' itime - say ' processing time ' showtime(itime) -* - iloc = 1 - while ( iloc <= nloc ) -* - result = read (ww3.mean.grads) - line = sublin(result,2) - ua.iloc.itime = subwrd(line,5) - ux.iloc.itime = subwrd(line,6) - uy.iloc.itime = subwrd(line,7) - ca.iloc.itime = subwrd(line,9) - cx.iloc.itime = subwrd(line,10) - cy.iloc.itime = subwrd(line,11) - hs.iloc.itime = subwrd(line,12) - gr.iloc.itime = subwrd(line,13) -* -* say result -* say iloc ' ' itime ' ' hs.iloc.itime -* say ua.iloc.itime ' ' ux.iloc.itime ' ' uy.iloc.itime -* say ca.iloc.itime ' ' cx.iloc.itime ' ' cy.iloc.itime -* - 'd ' par_ID.iloc - line = sublin(result,8) - lmin = subwrd(line,4) - lmax = subwrd(line,5) - if ( lmin < fmin) ; fmin = lmin ; endif - if ( lmax > fmax) ; fmax = lmax ; endif -* -* say result -* say fmin ' ' fmax ' ' lmin ' ' lmax -* - iloc = iloc + 1 -* - endwhile -* - itime = itime + 1 -* - endwhile -* - say ' ' - say 'Done, min and max for spectrum are ' fmin ' and ' fmax -* -* Generic page setup - - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say 'Setting up the page ...' -* - st1 = '' - st2 = '' - st3 = '' - st4 = '' -* - if ( nloc = 1 ) - ntest = ntime - itype = 0 - say ' Single location, location ID in header.' - else - ntest = nloc - itype = 1 - say ' Multiple locations, time ID in header.' - endif -* - if ( ntest = 1 ) - npan = 1 - else - if ( ntest <= 4 ) - npan = 4 - else - npan = 6 - endif - endif - say ' Putting ' npan ' panels on a page.' -* -* settings for 1 panel ... -* - if ( npan = 1 ) -* - xtc = 0.5 * xmax - yt1 = 9.1 - yt2 = 1.8 - yt3 = 2.0 - size1 = 0.25 - size2 = 0.12 - size3 = 0.12 - nc = 50 -* - pw = 6. - sx = 0. - sy = 0. - xp0 = 0.5 * ( xmax - pw ) - yp0 = 0.5 * ( ymax - pw ) -* - endif -* -* settings for 4 panel ... -* - if ( npan = 4 ) -* - xtc = 0.5 * xmax - yt1 = 10.0 - yt2 = 1.0 - yt3 = 1.2 - size1 = 0.22 - size2 = 0.12 - size3 = 0.12 - nc = 35 -* - pw = 3.6 - sx = 0.2 - sy = 0.5 - xp0 = 0.5 * ( xmax - sx ) - pw - yp0 = 0.5 * ( ymax + sy ) -* - endif -* -* settings for 6 panel ... -* - if ( npan = 6 ) -* - xtc = 0.5 * xmax - yt1 = 10.7 - yt2 = 0.2 - yt3 = 0.4 - size1 = 0.20 - size2 = 0.12 - size3 = 0.12 - nc = 35 -* - pw = 3.0 - sx = 0.2 - sy = 0.3 - xp0 = 0.5 * ( xmax - sx ) - pw - yp0 = 7.3 -* - endif -* -* Actual plotting loop - - - - - - - - - - - - - - - - - - - - - - -* - say ' ' - say 'Starting actual plotting ...' -* - ipage = 0 - ipan = 1 - xp = xp0 - yp = yp0 -* - i = 1 - while ( i <= ntime ) - 'set t ' i -* - j = 1 - while ( j <= nloc ) -* -* ... new page ... -* - if ( ipan = 1 ) -* - ipage = ipage + 1 - say ' Starting with page ' ipage -* - if ( ipage > 1 ) - iplot = ipage - 1 - 'printim spec_plot_'iplot'.png' - 'clear' - endif - - if ( npan = 1 ) - page_ID = 'Spectrum for ' - else - page_ID = 'Spectra for ' - endif - if ( itype = 0 ) - page_ID = page_ID loc_ID.j - else - page_ID = page_ID showtime (i) - endif - 'set string 1 c 5' - 'set strsiz ' size1 - 'draw string ' xtc ' ' yt1 ' ' page_ID - 'set strsiz ' size2 - 'draw string ' xtc ' ' yt2 ' ' grid_ID - 'set strsiz ' size3 - 'draw string ' xtc ' ' yt3 ' ' center_ID -* - endif -* -* ... plot spectrum ... -* - if ( itype = 0 ) - st1 = showtime(i) - else - st1 = loc_ID.j - endif -* - if ( hs.j.i < 10 ) - st2 = 'Hs = ' hs.j.i 'm' - else - st2 = 'Hs = ' hs.j.i 'm' - endif -* - if ( npan < 6 ) -* - if ( ua.j.i < 10 ) - st3 = 'U = ' ua.j.i 'm/s' - else - st3 = 'U = ' ua.j.i 'm/s' - endif -* - if ( ca.j.i < 0.1 ) - st4 = gr.j.i - else - st4 = gr.j.i ' C = ' ca.j.i 'm/s' - endif -* - endif -* - if ( polar = 'yes' ) - dummy = plotspec (xp,yp,pw,dth,dfr,fmx,par_ID.j,fmax,st1,st2,st3,st4,nc,ua.j.i,ux.j.i,uy.j.i,ca.j.i,cx.j.i,cy.j.i,color) - else - dummy = plotspec_c (xp,yp,pw,thoff,dth,fmn,fmx,dfr,par_ID.j,fmax,st1,st2,st3,st4,nc,ua.j.i,ux.j.i,uy.j.i,ca.j.i,cx.j.i,cy.j.i,color) - endif -* -* ... update panel counter ... -* - ipan = ipan + 1 - xp = xp + pw + sx - if ( xp + pw > xmax ) - xp = xp0 - yp = yp - pw - sy - endif - if ( ipan > npan ) - ipan = 1 - xp = xp0 - yp = yp0 - endif -* - j = j + 1 - endwhile -* - if ( nloc > 1 ) - ipan = 1 - xp = xp0 - yp = yp0 - endif -* - i = i + 1 - endwhile -* -* End of operations - - - - - - - - - - - - - - - - - - - - - - - -* -* - say ' ' - say '----------------------' - say '*** End of spec.gs ***' - say '----------------------' - say ' ' -* - 'quit' -* -* End of main script - - - - - - - - - - - - - - - - - - - - - - - - -* ------------------------------------------------------------------------------ - function plotspec (xp0,yp0,dxyp,dxgrid,dygrid,ymax,spec,scale,str1,str2,str3,str4,strlen,u,ux,uy,c,cx,cy,color) -* -* Function to plot a spectrum at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* dxgrid Grid line increment for directions. -* dygrid Grid line increment for frequencies. -* ymax Maximum frequency. -* spec Spectrum to be plotted. -* scale Scale (division) factor for spectrum. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* ux/y Wind speed and components. -* cx/y Current speed and components. -* color color of b&w [yes/---] -* -* 0. Initializations -* - 'set grads off' - 'set lon -180 180' - 'set lat ' 90-ymax ' 90' -* -* 1. Set up plot location -* - 'set parea ' xp0 ' ' xp0+dxyp ' ' yp0 ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 17 - factor = 2 - level=1.001 - levels='' -* - while ( i > 0 ) - level = level / factor - levels = level ' ' levels - i = i - 1 - endwhile -* -* 3. Plot spectrum -* - 'set mproj nps' - 'set grid off' -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' - 'd ' spec'/'scale - cblack = 1 - current = 65 - wind = 64 - else - cblack = 3 - current = 66 - wind = 63 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 4. Plot grid lines manually to avoid bug -* - if ( color = 'yes' ) - 'set line 66 5 3' - else - 'set line 66 1 3' - endif -* - x = 0 - while ( x < 360+0.1*dxgrid ) - 'q ll2xy 'x' '90.-dygrid - x1 = subwrd(result,1) - y1 = subwrd(result,2) - 'q ll2xy 'x' '90.-ymax - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - x = x + dxgrid - endwhile -* - dx = 5 - y = dygrid - while ( y < ymax + 0.1*dygrid ) - x = 0 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - while ( x < 360 ) - x = x+dx - x1 = x2 - y1 = y2 - 'q ll2xy 'x' '90.-y - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' ' y1 ' ' x2 ' ' y2 - endwhile - y = y + dygrid - endwhile -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 5. Plot current and wind vector -* - xc = xp0 + 0.5*dxyp - yc = yp0 + 0.5*dxyp -* -* 5.a current -* - 'set line ' current ' 1 6' -* - cmax = 1.5 - cmin = 0.1 - if ( c > cmin ) - if ( c < cmax ) - dc = 0.375 * (dygrid/ymax) * dxyp * c / cmax - else - dc = 0.375 * (dygrid/ymax) * dxyp - endif - dcx = dc * cx / c - dcy = dc * cy / c - x2 = xc - dcx - y2 = yc - dcy - x1 = xc + dcx - y1 = yc + dcy -* -* 'draw line ' x2 ' ' y2 ' ' x1 ' ' y1 -* - 'q xy2w 'x1' 'y1 - lon = subwrd(result,3) - lat = subwrd(result,6) - lonh = lon + 10 - lath = 90. - 0.75*(90.-lat) - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 - lonh = lon - 10 - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 -* - endif -* -* 5.b wind -* - 'set line ' wind ' 1 6' -* - umax = 20. - umin = 2.5 - if ( u > umin ) - if ( u < umax ) - du = 0.375 * (dygrid/ymax) * dxyp * u / umax - else - du = 0.375 * (dygrid/ymax) * dxyp - endif - dux = du * ux / u - duy = du * uy / u - x2 = xc - dux - y2 = yc - duy - x1 = xc + dux - y1 = yc + duy -* - 'draw line ' x2 ' ' y2 ' ' x1 ' ' y1 -* - 'q xy2w 'x1' 'y1 - lon = subwrd(result,3) - lat = subwrd(result,6) - lonh = lon + 10 - lath = 90. - 0.75*(90.-lat) - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 - lonh = lon - 10 - 'q ll2xy 'lonh' 'lath - x2 = subwrd(result,1) - y2 = subwrd(result,2) - 'draw line ' x1 ' 'y1 ' ' x2 ' ' y2 -* - endif -* -* 6. ID text around spectrum -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0 ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0 ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function plotspec_c (xp0,yp0,dxyp,xoff,dx,ymin,ymax,dy,spec,scale,str1,str2,str3,str4,strlen,u,ux,uy,c,cx,cy,color) -* -* Function to plot a spectrum at a given location on the page with identifying -* output around it -* -* Parameter list : -* -* x/yp0 Lower left corner of the plot in paper coordinates. -* dxy Size of the plot in paper coordinates. -* xoff Shift of first frequency (if 0, axis from 0-360 cartesian) -* dx Directional increment (axis). -* ymin Minimum frequency. -* ymax Maximum frequency. -* dy Frequency increment (axis). -* spec Spectrum to be plotted. -* scale Scale (division) factor for spectrum. -* strN Strings around the plot, top left, clockwise, set to '' -* to deactivate -* strlen Number of charcters from left to right, used to scale text -* ux/y Wind speed and components. -* cx/y Current speed and components. -* -* 0. Initializations -* - 'set grads off' - 'set lon ' xoff-270 ' ' xoff+90 - 'set lat ' 90-ymax ' ' 90-ymin -* -* 1. Set up plot location -* - 'set parea ' xp0+0.07*dxyp ' ' xp0+dxyp ' ' yp0+0.05*dxyp ' ' yp0+dxyp -* -* 2. Set up contour intervals -* - i = 15 - factor = 2 - level=1.001 - levels='' -* - while ( i > 0 ) - level = level / factor - levels = level ' ' levels - i = i - 1 - endwhile -* -* 3. Plot spectrum -* - 'set mproj scaled' - 'set xyrev on' - 'set xflip on' - 'set grid off' - 'set xlab off' - 'set ylab off' - labsize = dxyp / strlen / 1.25 - 'set ylopts 1 4 ' labsize - 'set ylint ' dx - 'set xlint ' dy -* - if ( color = 'yes' ) - 'set gxout shaded' - 'set clevs ' levels - 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' - 'd ' spec'/'scale - cblack = 1 - else - cblack = 3 - endif -* - 'set gxout contour' - 'set cthick ' cblack - 'set ccolor 60' - 'set clab off' - 'set clevs ' levels - 'd ' spec'/'scale -* -* 4. Plot axes manually -* - freq = 0. - 'set line 1 1 4' - 'set string 1 c 4' - 'set strsiz ' labsize -* - while ( freq <= ymax ) - if ( freq >= ymin ) - xt = xp0 + 0.07*dxyp + 0.93*dxyp * ( freq - ymin ) / ( ymax - ymin ) - 'draw line ' xt ' ' yp0+1.5*labsize ' ' xt ' ' yp0 + 0.05*dxyp - 'draw string ' xt ' ' yp0+0.5*labsize ' ' freq - endif - freq = freq + dy - endwhile -* - thmin = xoff - thmax = xoff + 360. - th = 0. -* - while ( th > thmin ) - th = th - dx - endwhile -* - 'set string 1 r 4' - while ( th <= thmax ) - if ( th >= thmin ) - yt = yp0 + 0.05*dxyp + 0.95*dxyp * ( th - thmin ) / ( thmax - thmin ) - 'draw line ' xp0+0.07*dxyp ' ' yt ' ' xp0+0.07*dxyp-0.5*labsize ' ' yt - 'draw string ' xp0+0.07*dxyp-1.0*labsize ' ' yt ' ' th - endif - th = th + dx - endwhile -* -* 5. Plot current and wind vector -* -* 6. ID text around spectrum -* - size = dxyp / strlen - 'set strsiz ' size -* - if ( str1 != '' ) - 'set string 1 bl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0+dxyp+0.75*size ' ' str1 - endif -* - if ( str2 != '' ) - 'set string 1 br 4' - 'draw string ' xp0+dxyp ' ' yp0+dxyp+0.75*size ' ' str2 - endif -* - if ( str3 != '' ) - 'set string 1 tr 4' - 'draw string ' xp0+dxyp ' ' yp0 -0.75*size ' ' str3 - endif -* - if ( str4 != '' ) - 'set string 1 tl 4' - 'draw string ' xp0+0.07*dxyp ' ' yp0 -0.75*size ' ' str4 - endif -* - return - -* ------------------------------------------------------------------------------ - function showtime (itime) -* -* Get date and time in preferred format -* -* Parameter list : -* -* itime Discrete time counter -* - 'set t ' itime - 'query time' - gradsdate = subwrd(result,3) - test = substr ( gradsdate, 3, 1 ) - if ( test='Z' ) - year = substr ( gradsdate, 9, 4 ) - mnth = substr ( gradsdate, 6, 3 ) - day = substr ( gradsdate, 4, 2 ) - hour = substr ( gradsdate, 1, 2 ) - min = '00' - else - year = substr ( gradsdate, 12, 4 ) - mnth = substr ( gradsdate, 9, 3 ) - day = substr ( gradsdate, 7, 2 ) - hour = substr ( gradsdate, 1, 2 ) - min = substr ( gradsdate, 4, 2 ) - endif - - month= '??' - if (mnth='JAN'); month= '01'; endif; - if (mnth='FEB'); month= '02'; endif; - if (mnth='MAR'); month= '03'; endif; - if (mnth='APR'); month= '04'; endif; - if (mnth='MAY'); month= '05'; endif; - if (mnth='JUN'); month= '06'; endif; - if (mnth='JUL'); month= '07'; endif; - if (mnth='AUG'); month= '08'; endif; - if (mnth='SEP'); month= '09'; endif; - if (mnth='OCT'); month= '10'; endif; - if (mnth='NOV'); month= '11'; endif; - if (mnth='DEC'); month= '12'; endif; - - if ( test='Z' ) - vdate = year '/' month '/' day ' ' hour 'z' - else - vdate = year '/' month '/' day ' ' hour ':' min 'z' - endif -* - return vdate diff --git a/model/aux/spec_ids.gen b/model/aux/spec_ids.gen deleted file mode 100644 index 20a982b48..000000000 --- a/model/aux/spec_ids.gen +++ /dev/null @@ -1,2 +0,0 @@ -unidentified test (set in file spec_ids) -WAVEWATCH III TEST diff --git a/model/bin/comp.Altix b/model/bin/comp.Altix deleted file mode 100755 index 5e0d1116c..000000000 --- a/model/bin/comp.Altix +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -fast -fp-model source -assume byterecl -convert big_endian -module $path_m" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Altix_debug b/model/bin/comp.Altix_debug deleted file mode 100755 index 4214375eb..000000000 --- a/model/bin/comp.Altix_debug +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -CB -O0 -fpe0 -fp-model source -traceback -assume byterecl -convert big_endian -module $path_m" - opt="-p -pg -g $opt" - opt="-check bounds -check uninit -ftrapuv -warn -warn interface $opt" - opt="-fno-alias -fno-fnalias -debug -check all -implicitnone -warn all -fp-stack-check -heap-arrays $opt" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.DATARMOR b/model/bin/comp.DATARMOR deleted file mode 100755 index 9276ab109..000000000 --- a/model/bin/comp.DATARMOR +++ /dev/null @@ -1,293 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -module $path_m" - - -################################################################################ -# *** System-dependant instructions # -# -xHost : Generates instructions for the highest instruction set available on # -# the compilation host processor # -# -xcore-avx2 : Intel Advanced Vector Extensions 2 # -# -no-fma : Generates separate multiply and add instructions with intermediate # -# rounding # -# # -# The value for must be lower case on Linux or OS X # -################################################################################ - opt="$opt -xHost -no-fma" - - -################################################################################ -# *** Optimization levels # -# -O0 : No optimizations applied # -# -O1 : Provides a minimum of statement–level optimizations # -# -O2 : Enables basic block level optimizations # -# -O3 : Adds loop unrolling and global optimizations at the function level # -# -O4 : Adds automatic inlining of routines contained in the same file # -# -ip : Enables interprocedural optimizations for single-file compilation # -# # -# Debugging with -g does not suppress -On, but -On limits -g in certain ways # -################################################################################ - opt="$opt -O3 -ip" - - -################################################################################ -# *** Profiling and debugging analysis # -# -p : Profiling # -# -pg : Profiling with statistics in gmon.out # -# -g : Compiles for debugging and performance analysis. # -# -debug all : Generates complete debugging information # -# # -# The compiler options -p, -pg, or -xpg should not be used to compile # -# multi-threaded programs, because the runtime support for these options is # -# not thread-safe. If a program that uses multiple threads is compiled with # -# these options invalid results or a segmentation fault could occur at runtime # -# If you compile with -pg, then be sure to link with -pg. # -################################################################################ - opt="$opt -p" -# opt="$opt -g -debug all" - - -################################################################################ -# *** Warning messages # -# -warn all : Specifies all diagnostic messages to be issued by the compiler # -# -warn declarations : Enables warnings about any undeclared names. Equivalent # -# to -implicitnone # -################################################################################ -# opt="$opt -warn all" - - -################################################################################ -# *** Check messages # -# -check all : Checks for all conditions at run time # -# -check noarg_temp_created : Disables message for temporary array created # -################################################################################ -# opt="$opt -check all -check noarg_temp_created - - -################################################################################ -# *** Numbers format # -# -fp-model precise : Disables optimizations that are not value-safe on # -# floating-point data and rounds intermediate results to # -# source-defined precision # -# -assume byterecl : Defines the record length in bytes for the OPEN statement # -# RECL specifier in unformatted files # -# -convert big-endian: Specifies that the format will be big endian for # -# integer data and big endian IEEE floating-point for # -# real and complex data # -# -fp-stack-check : Generates extra code after every function call to ensure # -# that the floating-point stack is in the expected state # -################################################################################ - opt="$opt -fp-model precise -assume byterecl -convert big_endian" -# opt="$opt -fp-stack-check" - - -################################################################################ -# *** Aliasing # -# -fno-alias : Aliasing during a procedure call is not assumed # -# -fno-fnalias : Aliasing is not assumed within functions, but it is assumed # -# across calls # -################################################################################ - opt="$opt -fno-alias -fno-fnalias" - - -################################################################################ -# *** Memory setting # -# -heap-arrays : Puts automatic arrays and arrays for temporary computations # -# on the heap instead of the stack # -# -traceback : Issue a stack trace if a severe error occurs in execution # -# # -# If you compile with -traceback, then be sure to link with -traceback # -# The heap is memory set aside for dynamic allocation # -# The stack is the memory set aside as scratch space for a thread of execution # -# Each thread gets a stack, while there is only one heap for the application # -################################################################################ -# opt="$opt -heap-arrays -traceback" - - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=ifort - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -qopenmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.DATARMOR_debug b/model/bin/comp.DATARMOR_debug deleted file mode 100755 index 2cea76574..000000000 --- a/model/bin/comp.DATARMOR_debug +++ /dev/null @@ -1,293 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -module $path_m" - - -################################################################################ -# *** System-dependant instructions # -# -xHost : Generates instructions for the highest instruction set available on # -# the compilation host processor # -# -xcore-avx2 : Intel Advanced Vector Extensions 2 # -# -no-fma : Generates separate multiply and add instructions with intermediate # -# rounding # -# # -# The value for must be lower case on Linux or OS X # -################################################################################ - opt="$opt -xHost -no-fma" - - -################################################################################ -# *** Optimization levels # -# -O0 : No optimizations applied # -# -O1 : Provides a minimum of statement–level optimizations # -# -O2 : Enables basic block level optimizations # -# -O3 : Adds loop unrolling and global optimizations at the function level # -# -O4 : Adds automatic inlining of routines contained in the same file # -# -ip : Enables interprocedural optimizations for single-file compilation # -# # -# Debugging with -g does not suppress -On, but -On limits -g in certain ways # -################################################################################ - opt="$opt -O0 -ip" - - -################################################################################ -# *** Profiling and debugging analysis # -# -p : Profiling # -# -pg : Profiling with statistics in gmon.out # -# -g : Compiles for debugging and performance analysis. # -# -debug all : Generates complete debugging information # -# # -# The compiler options -p, -pg, or -xpg should not be used to compile # -# multi-threaded programs, because the runtime support for these options is # -# not thread-safe. If a program that uses multiple threads is compiled with # -# these options invalid results or a segmentation fault could occur at runtime # -# If you compile with -pg, then be sure to link with -pg. # -################################################################################ - opt="$opt -p" - opt="$opt -g -debug all" - - -################################################################################ -# *** Warning messages # -# -warn all : Specifies all diagnostic messages to be issued by the compiler # -# -warn declarations : Enables warnings about any undeclared names. Equivalent # -# to -implicitnone # -################################################################################ - opt="$opt -warn all" - - -################################################################################ -# *** Check messages # -# -check all : Checks for all conditions at run time # -# -check noarg_temp_created : Disables message for temporary array created # -################################################################################ - opt="$opt -check all -check noarg_temp_created" - - -################################################################################ -# *** Numbers format # -# -fp-model precise : Disables optimizations that are not value-safe on # -# floating-point data and rounds intermediate results to # -# source-defined precision # -# -assume byterecl : Defines the record length in bytes for the OPEN statement # -# RECL specifier in unformatted files # -# -convert big-endian: Specifies that the format will be big endian for # -# integer data and big endian IEEE floating-point for # -# real and complex data # -# -fp-stack-check : Generates extra code after every function call to ensure # -# that the floating-point stack is in the expected state # -################################################################################ - opt="$opt -fp-model precise -assume byterecl -convert big_endian" - opt="$opt -fp-stack-check" - - -################################################################################ -# *** Aliasing # -# -fno-alias : Aliasing during a procedure call is not assumed # -# -fno-fnalias : Aliasing is not assumed within functions, but it is assumed # -# across calls # -################################################################################ - opt="$opt -fno-alias -fno-fnalias" - - -################################################################################ -# *** Memory setting # -# -heap-arrays : Puts automatic arrays and arrays for temporary computations # -# on the heap instead of the stack # -# -traceback : Issue a stack trace if a severe error occurs in execution # -# # -# If you compile with -traceback, then be sure to link with -traceback # -# The heap is memory set aside for dynamic allocation # -# The stack is the memory set aside as scratch space for a thread of execution # -# Each thread gets a stack, while there is only one heap for the application # -################################################################################ - opt="$opt -heap-arrays -traceback" - - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=ifort - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -qopenmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Gnu b/model/bin/comp.Gnu deleted file mode 100755 index 087f43c5b..000000000 --- a/model/bin/comp.Gnu +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the GNU compilers on any architecture. # -# # -# Timothy J. Campbell # -# October 2009 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Gnu compiler on Linux ------------------------------------------------------ -# 2.b.1 Build options and determine compiler name -# Note that all but GrADS output is forced to big endian data - -# Notes re: changing compilers (important) -# ...1) run cleaner scrip to get rid of old .mod and .o files -# ...2) change switch or remove makefile to force creation of new makefile -# ...3) use -c {compiler name} in run_test - -# Gnu: -# -Idir : where to search for .mod files -# -Jdir or -Mdir : where to put .mod files - - # compilation options - opt="-c -O3 -fno-second-underscore -ffree-line-length-none -fconvert=big-endian -J$path_m" -# opt="$opt -I$HOME/g2lib -I/opt/local/include" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=gfortran - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -fopenmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Gnu_debug b/model/bin/comp.Gnu_debug deleted file mode 100755 index 3e8eb2c74..000000000 --- a/model/bin/comp.Gnu_debug +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the GNU compilers on any architecture. # -# # -# Timothy J. Campbell # -# October 2009 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Gnu compiler on Linux ------------------------------------------------------ -# 2.b.1 Build options and determine compiler name -# Note that all but GrADS output is forced to big endian data - -# Notes re: changing compilers (important) -# ...1) run cleaner scrip to get rid of old .mod and .o files -# ...2) change switch or remove makefile to force creation of new makefile -# ...3) use -c {compiler name} in run_test - -# Gnu: -# -Idir : where to search for .mod files -# -Jdir or -Mdir : where to put .mod files - - # compilation options - opt="-c -g -O0 -fbounds-check -fbacktrace -fno-second-underscore -ffree-line-length-none -fconvert=big-endian -J$path_m" -# opt="$opt -I$HOME/g2lib -I/opt/local/include" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=gfortran - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -fopenmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Intel b/model/bin/comp.Intel deleted file mode 100755 index 5491ecb56..000000000 --- a/model/bin/comp.Intel +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 12 on Xeon Westmere # -# - On zeus the -list option slows down the compilation time by an order # -# of magnitude. For this section 1.c is added. # -# # -# Hendrik L. Tolman # -# June 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# 1.c Set listing option - - - - - - - - - - - - - - - - - - - - - - - - - - - - - list=' -list' - list= - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - opt="-c $list -O3 -assume byterecl -ip -module $path_m" -# opt="-c $list -O3 -assume byterecl -xSSE4.2 -ip -module $path_m" -# opt="-c $list -O3 -assume byterecl -prec-div -prec-sqrt -xHost -align array128byte -ip -module $path_m" -# opt="-c $list -O0 -assume byterecl -g -traceback -check all -fpe0 -ftrapuv -module $path_m" - - if [ "$name" != 'ww3_gspl' ] - then - opt="$opt -convert big_endian" - fi - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - which mpiifort 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp=ifort - fi - - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Intel_debug b/model/bin/comp.Intel_debug deleted file mode 100755 index ec28fcf2b..000000000 --- a/model/bin/comp.Intel_debug +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/sh -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - - opt="-c -xCORE-AVX2 -O0 -fno-alias -fp-model precise -assume byterecl -convert big_endian -no-fma -ip -module $path_m" - opt="-CB -traceback $opt" - opt="-p -pg -g $opt" - opt="-check bounds -check uninit -ftrapuv -warn -warn interface $opt" - opt="-fno-alias -fno-fnalias -debug -check all -implicitnone -warn all -fp-stack-check -heap-arrays $opt" - opt="-c $list -O0 -assume byterecl -g -traceback -check all -fpe0 -ftrapuv -module $path_m" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - which mpiifort 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp=ifort - fi - - else - comp=ifort - fi - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Lahey b/model/bin/comp.Lahey deleted file mode 100755 index 22c14df6a..000000000 --- a/model/bin/comp.Lahey +++ /dev/null @@ -1,192 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Lahey lf95 compiler version 8.1 and up. # -# # -# Hendrik L. Tolman # -# July 2013 # -# # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Lahey compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c --lst --fast -M $path_m" -# opt="-c --lst -g --trap --chk --chkglobal -M $path_m" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=lf95 -Lmpi - else - comp=lf95 - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt i--openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'Encountered' $name.err | grep 'errors' | awk '{ print $2}'` - nr_war=`grep 'Encountered' $name.err | grep 'errors' | awk '{ print $4}'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Mpt b/model/bin/comp.Mpt deleted file mode 100755 index 8898b0d1e..000000000 --- a/model/bin/comp.Mpt +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -O3 -fp-model precise -assume byterecl -convert big_endian -module $path_m" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp='ifort -lmpi' - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Mpt_debug b/model/bin/comp.Mpt_debug deleted file mode 100755 index 866ccfb8f..000000000 --- a/model/bin/comp.Mpt_debug +++ /dev/null @@ -1,192 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -O0 -assume byterecl -convert big_endian -module $path_m" - opt="-p -pg -g $opt" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp='ifort -lmpi' - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.NEC b/model/bin/comp.NEC deleted file mode 100755 index c5fcebcfe..000000000 --- a/model/bin/comp.NEC +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 - Customised for compilation on the # -# NEC SX6/SX8 supercomputer using the sxf90 compiler # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# # -# Hendrik L. Tolman # -# February 2005 # -# # -# Modification history: # -# # -# 05-Mar-2008 Modified original compile script for use on NEC. # -# (Chris Bunney, UK Met Office) # -# # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# sxf90 cross compiler under Linux-------------------------------------------- -# 2.b.1 Build options and determine compiler name - -# compiler flags description: -# -c Compilation only (no link) -# -f2003 Compile to Fortran 2003 standard. -# -Chopt Use highest level of vector optimisation. -# -Wf'-pvctl vwork=stack' Use the stack for vector work space. -# -Wf'-M noinv' Don't report invalid operation errors. -# -Wf'-M noflovf' Don't report floating point overflow errors. -# -Wf'-cont' Specifies to use an array pointer name or an assumed shape array -# name in the actual argument list or the input/output list contiguously. -# The compiler does not use a work array for the variable. -# -I Module include path - - opt="-c -f2003 -Chopt -Wf'-pvctl vwork=stack' -Wf'-M noinv' -Wf'-M noflovf' -Wf'-cont' -I $path_m" - -# If you have a large model with more than 5000 sea points, it might be necessary to increase the -# compiler's maximum vector loop size. If the loop size (default 5000) is less than the number of model sea -# points, you will get run time errors similar to "Loop count is greater than that assumed by the compiler:". -# To fix this un-comment the following line and set 'xxx' to be >= to number of model sea points: -# -# opt="$opt -Wf'-pvctl loopcnt=xxx'" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=sxmpif90 - else - comp=sxf90 - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - eval $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - -# if [ -s $name.lst ] -# then -# mv $name.lst $name.l -# fi - -# 2.b.3 Add test output to listing for later viewing - -# if [ -s $name.l ] -# then -# echo '------------' >> $name.l -# echo "$comp $opt" >> $name.l -# echo '------------' >> $name.l -# cat $name.out >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# cat $name.err >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - echo > /dev/null - - nr_err=`grep -i 'f[97][750]: error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep -i 'f[97][750]: warn' $name.err | wc -l | awk '{ print $1 }'` - - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.Portland b/model/bin/comp.Portland deleted file mode 100755 index 7c0dcb9e1..000000000 --- a/model/bin/comp.Portland +++ /dev/null @@ -1,237 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Portland pgf90 compiler versions 6 and up. # -# # -# Hendrik L. Tolman # -# February 2012 # -# # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Portland Group Inc FORTRAN on Redhad Linux -------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -Mlist -module $path_m" ; fast="yes" -# opt="-c -Mlist -fast -module $path_m" - -# opt="-c -O0 -g -traceback -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -Mlist -module $path_m" ; fast= - - if [ "$name" != 'ww3_gspl' ] - then - opt="$opt -byteswapio" - fi - - if [ "$fast" = 'yes' ] - then - if [ "$name" = 'w3iogrmd' ] || [ "$name" = 'w3iogomd' ] - then - opt="-O3 $opt" - else - opt="-fast $opt" - fi - else - opt="-O3 $opt" - fi - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=pgf90 - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - echo > /dev/null - - grep inform $name.err | grep warnings | grep severes > $name.err2 - mv $name.err2 $name.err - err_lines=`wc -l $name.err | awk '{ print $1 }'` - - nr_inf=0 - nr_war=0 - nr_sev=0 - nr_fat=0 - - line=1 - while [ "$line" -le "$err_lines" ] - do - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $1}'` - nr_inf=$(($nr_inf + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $3}'` - nr_war=$(($nr_war + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $5}'` - nr_sev=$(($nr_sev + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $7}'` - nr_fat=$(($nr_fat + $nr_loc)) - line=$(($line + 1)) - done - - nr_err=$(($nr_sev + $nr_fat)) - nr_war=$(($nr_war + $nr_inf)) - - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.SGI_Xeon_Intel b/model/bin/comp.SGI_Xeon_Intel deleted file mode 100755 index 875ed671e..000000000 --- a/model/bin/comp.SGI_Xeon_Intel +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for an SGI Altix Linux cluster with Dual-core Xeon # -# processors (Woodcrest 5160). The compiler is Intel Fortran 10.1.1008. # -# # -# Hendrik L. Tolman # -# Fabrice Ardhuin # -# February 2008 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name -# Note that all but GrADS output is forced to big endian data -# -# options for fast executable on SGI Linux cluster with -# 3.0Ghz Intel Dual-core Xeon Processors(Woodcrest 5160) -# compiler used is Intel Fortran 10.1.1008 - - # compilation options - opt="-c -O3 -assume byterecl -convert big_endian -module $path_m" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - opt="-c -xT -ipo -O3 -assume byterecl -convert big_endian -module $path_m" - comp=mpiifort - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - -# if [ -s $name.lst ] -# then -# mv $name.lst $name.l -# fi - -# 2.b.3 Add test output to listing for later viewing - -# if [ -s $name.l ] -# then -# echo '------------' >> $name.l -# echo "$comp $opt" >> $name.l -# echo '------------' >> $name.l -# cat $name.out >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# cat $name.err >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - echo > /dev/null - - nr_err=`grep 'fortcom: Error:' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'fortcom: Warning:' $name.err | wc -l | awk '{ print $1 }'` - - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.cray_xc.Intel b/model/bin/comp.cray_xc.Intel deleted file mode 100755 index eedf15bba..000000000 --- a/model/bin/comp.cray_xc.Intel +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 12 on Xeon Westmere # -# - On zeus the -list option slows down the compilation time by an order # -# of magnitude. For this section 1.c is added. # -# # -# Hendrik L. Tolman # -# June 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# 1.c Set listing option - - - - - - - - - - - - - - - - - - - - - - - - - - - - - list=' -list' - list= - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** -# *** (nothing to do here) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name -# Note that all but GrADS output is forced to big endian data - - opt="-c $list -module $path_m" - opt="$opt -xHost -O3 -ip -fno-alias -fp-model strict -no-fma -ftz" - opt="$opt -i4 -real-size 32" - opt="$opt -traceback" - - if [ "$name" != 'gx_outp' ] && [ "$name" != 'gx_outf' ] && \ - [ "$name" != 'ww3_gspl' ] - then - opt="$opt -convert big_endian -assume byterecl" - fi - - if [ "$mpi_mod" = 'yes' ] - then - comp=ftn - else - comp=ftn - fi - - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp -openmp-report=1" - fi - - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - -# if [ -s $name.l ] -# then -# echo '------------' >> $name.l -# echo "$comp $opt" >> $name.l -# echo '------------' >> $name.l -# cat $name.out >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# cat $name.err >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.cray_xc.Portland b/model/bin/comp.cray_xc.Portland deleted file mode 100755 index ba9252cf5..000000000 --- a/model/bin/comp.cray_xc.Portland +++ /dev/null @@ -1,223 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 12 on Xeon Westmere # -# - On zeus the -list option slows down the compilation time by an order # -# of magnitude. For this section 1.c is added. # -# # -# Hendrik L. Tolman # -# June 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# 1.c Set listing option - - - - - - - - - - - - - - - - - - - - - - - - - - - - - list=' -Mlist' - list= - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** -# *** (nothing to do here) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name -# Note that all but GrADS output is forced to big endian data - - opt="-c $list -module $path_m" - opt="$opt -fastsse" - opt="$opt -i4 -r4" - opt="$opt -traceback" - - if [ "$name" != 'gx_outp' ] && [ "$name" != 'gx_outf' ] && \ - [ "$name" != 'ww3_gspl' ] - then - opt="$opt -byteswapio" - fi - - if [ "$mpi_mod" = 'yes' ] - then - comp=ftn - else - comp=ftn - fi - - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - echo > /dev/null - - grep inform $name.err | grep warnings | grep severes > $name.err2 - mv $name.err2 $name.err - err_lines=`wc -l $name.err | awk '{ print $1 }'` - - nr_inf=0 - nr_war=0 - nr_sev=0 - nr_fat=0 - - line=1 - while [ "$line" -le "$err_lines" ] - do - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $1}'` - nr_inf=$(($nr_inf + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $3}'` - nr_war=$(($nr_war + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $5}'` - nr_sev=$(($nr_sev + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $7}'` - nr_fat=$(($nr_fat + $nr_loc)) - line=$(($line + 1)) - done - - nr_err=$(($nr_sev + $nr_fat)) - nr_war=$(($nr_war + $nr_inf)) - - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.cray_xt b/model/bin/comp.cray_xt deleted file mode 100755 index e8dc908ab..000000000 --- a/model/bin/comp.cray_xt +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Cray XT series. # -# # -# James D. Dykes # -# April 2010 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK - -# Cray compiler -------------------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - opt="-c -Mlist -fastsse -module $path_m" - - # seq implementation - comp=ftn - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - echo > /dev/null - - grep inform $name.err | grep warnings | grep severes > $name.err2 - mv $name.err2 $name.err - err_lines=`wc -l $name.err | awk '{ print $1 }'` - - nr_inf=0 - nr_war=0 - nr_sev=0 - nr_fat=0 - - line=1 - while [ "$line" -le "$err_lines" ] - do - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $1}'` - nr_inf=$(($nr_inf + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $3}'` - nr_war=$(($nr_war + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $5}'` - nr_sev=$(($nr_sev + $nr_loc)) - nr_loc=`sed -n "$line,${line}p" $name.err | awk '{ print $7}'` - nr_fat=$(($nr_fat + $nr_loc)) - line=$(($line + 1)) - done - - nr_err=$(($nr_sev + $nr_fat)) - nr_war=$(($nr_war + $nr_inf)) - - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.datamor.intel b/model/bin/comp.datamor.intel deleted file mode 100755 index c8f3c6246..000000000 --- a/model/bin/comp.datamor.intel +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 12 on Xeon Westmere # -# - On zeus the -list option slows down the compilation time by an order # -# of magnitude. For this section 1.c is added. # -# # -# Hendrik L. Tolman # -# June 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# 1.c Set listing option - - - - - - - - - - - - - - - - - - - - - - - - - - - - - list=' -list' - list= - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - opt="-c $list -O3 -assume byterecl -ip -module $path_m" -# opt="-c $list -O3 -assume byterecl -xSSE4.2 -ip -module $path_m" -# opt="-c $list -O3 -assume byterecl -prec-div -prec-sqrt -xHost -align array128byte -ip -module $path_m" -# opt="-c $list -O0 -assume byterecl -g -traceback -check all -fpe0 -ftrapuv -module $path_m" - - if [ "$name" != 'ww3_gspl' ] - then - opt="$opt -convert big_endian" - fi - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - which mpiifort 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp=ifort - fi - - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.kubuntu.intel.mpich b/model/bin/comp.kubuntu.intel.mpich deleted file mode 100755 index 32654a206..000000000 --- a/model/bin/comp.kubuntu.intel.mpich +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the Intel ifort version 12 on Xeon Westmere # -# - On zeus the -list option slows down the compilation time by an order # -# of magnitude. For this section 1.c is added. # -# # -# Hendrik L. Tolman # -# June 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# 1.c Set listing option - - - - - - - - - - - - - - - - - - - - - - - - - - - - - list=' -list' - list= - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - opt="-c $list -O3 -assume byterecl -ip -module $path_m" -# opt="-c $list -O3 -assume byterecl -xSSE4.2 -ip -module $path_m" -# opt="-c $list -O3 -assume byterecl -prec-div -prec-sqrt -xHost -align array128byte -ip -module $path_m" -# opt="-c $list -O0 -assume byterecl -g -traceback -check all -fpe0 -ftrapuv -module $path_m" - - if [ "$name" != 'ww3_gspl' ] - then - opt="$opt -convert big_endian" - fi - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - which mpif90 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp=ifort - fi - - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - fi - -# 2.b.3 Add test output to listing for later viewing - - if [ -s $name.l ] - then - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l 2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l 2> /dev/null - echo '------------' >> $name.l - fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/comp.mac_pro_Intel b/model/bin/comp.mac_pro_Intel deleted file mode 100755 index 02a25cda1..000000000 --- a/model/bin/comp.mac_pro_Intel +++ /dev/null @@ -1,198 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is modified to work with the intel compiler on a mac pro. # -# NOTE: -g flag may result in link errors. Monte thinks this is a compiler # -# error. # -# # -# Hendrik L. Tolman # -# Monte Hanson # -# February 2008 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK -# -# Intel compiler on Linux ---------------------------------------------------- -# 2.b.1 Build options and determine compiler name - - # compilation options - #opt="-c CB -list -O3 -assume byterecl -convert big_endian -module $path_m" - #opt="-c $list -assume byterecl -g -traceback -debug full -convert big_endian -use-asm -O3 -xSSE4.2 -module $path_m" - opt="-c -heap-arrays 20480 -assume byterecl -zero -O3 -mssse3 -convert big_endian -module $path_m" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing - -# if [ -s $name.lst ] -# then -# mv $name.lst $name.l -# fi - -# 2.b.3 Add test output to listing for later viewing - -# if [ -s $name.l ] -# then -# echo '------------' >> $name.l -# echo "$comp $opt" >> $name.l -# echo '------------' >> $name.l -# cat $name.out >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# cat $name.err >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'` - nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'` - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # - - - diff --git a/model/bin/comp.xlf b/model/bin/comp.xlf deleted file mode 100755 index d70dd014b..000000000 --- a/model/bin/comp.xlf +++ /dev/null @@ -1,228 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# comp : Compiler script for use in ad3 (customized for hardware and # -# optimization). Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. Used by ad3. # -# # -# use : comp name # -# name: name of source code file without the extension. # -# # -# error codes : 1 : input error # -# 2 : no environment file $ww3_env found. # -# 3 : error in creating scratch directory. # -# 4 : w3adc error. # -# 5 : compiler error. # -# # -# remarks : # -# # -# - This script runs from the scratch directory, where it should remain. # -# # -# - For this script to interact with ad3, it needs to generate / leave # -# following files : # -# $name.f90 : Source code (generated by ad3). # -# $name.o : Object module. # -# $name.l : Listing file. # -# comp.stat.$name : status file of compiler, containing number of errors # -# and number of warnings (generated by comp). # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this script : # -# sec. 2.b : Provide correct compiler/options. # -# sec. 3.a : Provide correct error capturing. # -# sec. 3.d : Remove unnecessary files. # -# # -# - This version is made for the IBM xlf compiler version 8.1.1.6 # -# on an RS6000 SP wth power4 processors. # -# # -# Hendrik L. Tolman # -# February 2005 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" != '1' ] - then - echo "usage: comp name" ; exit 1 - fi - name="$1" - -# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $name.l - rm -f $name.o - rm -f comp.stat.$name - -# --------------------------------------------------------------------------- # -# 2. Compile # -# --------------------------------------------------------------------------- # -# Add here the correct compiler call including command line options -# Note: - do not invoke a link step -# - if possible, generate a listing $name.l -# - make sure the compiler point to the proper directory where the -# modules are stored ($m_path), see examples below. - -# 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - - -# .f90 assumes free format, .f assumes fixed format, change if necessary -# *** file extension (fext) is set and exported by calling program (ad3) *** - -# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - - -# Save compiler exit code in $OK - - -# IBM RS6000 SP with xlf ----------------------------------------------------- -# 2.b.1 Build options and determine compiler name -# This compiler expects the .f extension -# My compiler had problems optimizing xnlserv.f90 - - if [ -f $name.f90 ] - then - mv $name.f90 $name.f - fi - fext='f' - - # compilation options - opt="-c -qsource -O3 -qstrict -qarch=auto -qtune=auto -qcache=auto -qfloat=hsflt -I$path_m -qnosave" - -# debug=' -g -C -qcheck -qfltrap:enable -qsigtrap -qfullpath' - debug= - - opt="$opt$debug" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp="mpxlf90_r -q64" - else - comp="xlf90_r -q64" - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - comp="xlf90_r -q64" - opt="$opt -qsmp=noauto" - fi - - # oasis coupler include dir - if [ "$oasis_mod" = 'yes' ] - then - opt="$opt -I$OASISDIR/build/lib/psmile.MPI1" - fi - - # netcdf include dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) opt="$opt -I$NETCDF_INCDIR" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - opt="$opt -I`$NETCDF_CONFIG --includedir`" ;; - esac - fi - - # ftn include dir - opt="$opt -I$path_i" - opt="$opt $ESMF_F90COMPILEPATHS" - opt="$opt $EXTRA_COMP_OPTIONS" - -# 2.b.2 Compile - - $comp $opt $name.$fext > $name.out 2> $name.err - OK="$?" - -# 2.b.2 Process listing -# For this compiler i need to get error information from the listing - - if [ -s $name.lst ] - then - mv $name.lst $name.l - sed -n '/^TOTAL UNR/,/^$/p' $name.l | head -3 > $name.err2 - fi - -# 2.b.3 Add test output to listing for later viewing - -# if [ -s $name.l ] -# then -# echo '------------' >> $name.l -# echo "$comp $opt" >> $name.l -# echo '------------' >> $name.l -# cat $name.out >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# cat $name.err >> $name.l 2> /dev/null -# echo '------------' >> $name.l -# fi - -# --------------------------------------------------------------------------- # -# 3. Postprocessing # -# --------------------------------------------------------------------------- # -# 3.a Capture errors -# nr_err : number of errors. -# nr_war : number of errors. - - nr_err='0' - nr_war='0' - - if [ -s $name.err ] - then - echo > /dev/null - - if [ -s $name.err2 ] - then - - nr_tot2="`tail -1 $name.err2 | awk '{ print $1}'`" - nr_unr2="`tail -1 $name.err2 | awk '{ print $2}'`" - nr_sev2="`tail -1 $name.err2 | awk '{ print $3}'`" - nr_err2="`tail -1 $name.err2 | awk '{ print $4}'`" - nr_war2="`tail -1 $name.err2 | awk '{ print $5}'`" - nr_inf2="`tail -1 $name.err2 | awk '{ print $6}'`" - - nr_err=$(($nr_unr2 + $nr_sev2)) - nr_war=$(($nr_err2 + $nr_war2)) - else - OK=1 - fi - - rm -f $name.err2 - -# End hardware / software dep. ------------- - - else - if [ "$OK" != '0' ] - then - nr_err='1' - fi - fi - -# 3.b Make file comp.stat.$name - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo "ERROR $nr_err" > comp.stat.$name - echo "WARNING $nr_war" >> comp.stat.$name - -# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# if compiler does not provide listing, make listing from source code -# and compiler messages. Second input line for w3list identifies if -# comment lines are to be numbered. - - if [ ! -f $name.l ] - then - echo "$name.$fext" > w3list.inp - echo "T" >> w3list.inp - w3list < w3list.inp 2> /dev/null - rm -f w3list.inp - mv w3list.out $name.l - echo '------------' >> $name.l - echo "$comp $opt" >> $name.l - echo '------------' >> $name.l - cat $name.out >> $name.l #2> /dev/null - echo '------------' >> $name.l - cat $name.err >> $name.l #2> /dev/null - echo '------------' >> $name.l - fi - -# 3.d Remove unwanted files - - - - - - - - - - - - - - - - - - - - - - - - - -# include here unwanted files generated by the compiler - -# rm -f $name.out -# rm -f $name.err - -# end of comp --------------------------------------------------------------- # diff --git a/model/bin/link.Gnu b/model/bin/link.Gnu deleted file mode 100755 index 6f496a65e..000000000 --- a/model/bin/link.Gnu +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the GNU compilers on any architecture. # -# # -# Timothy J. Campbell # -# October 2009 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" -# libs="-L/opt/local/lib -L$HOME/g2lib -lg2 -lw3 -lpng -ljasper" - opt="-o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=gfortran - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -fopenmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Gnu_debug b/model/bin/link.Gnu_debug deleted file mode 100755 index 6f496a65e..000000000 --- a/model/bin/link.Gnu_debug +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the GNU compilers on any architecture. # -# # -# Timothy J. Campbell # -# October 2009 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" -# libs="-L/opt/local/lib -L$HOME/g2lib -lg2 -lw3 -lpng -ljasper" - opt="-o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=gfortran - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -fopenmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Intel b/model/bin/link.Intel deleted file mode 100755 index d91226912..000000000 --- a/model/bin/link.Intel +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 12 on nehalem. # -# processor. # -# # -# Hendrik L. Tolman # -# February 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-O3 -ip -o $prog" -# opt="-O3 -xSSE4.2 -ip -o $prog" -# opt="-O3 -prec-div -prec-sqrt -xHost -align array128byte -ip -o $prog" -# opt="-O0 -g -traceback -check all -fpe0 -ftrapuv -o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - which mpiifort 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp='ifort -lmpi' - fi -# opt="-O3 -o $prog" - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Intel_debug b/model/bin/link.Intel_debug deleted file mode 100755 index b1f59f4d2..000000000 --- a/model/bin/link.Intel_debug +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/sh -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="-L/appli/ddt/ddt-7.0.6/lib/64 -dlmalloc" - opt="-O0 -xCORE-AVX2 -o $prog" - opt="-Zp8 -tpp7 $opt" - opt="-p -pg -g $opt" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - which mpiifort 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp='ifort -lmpi' - fi -# opt="-O3 -o $prog" - else - comp=ifort - fi - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Lahey b/model/bin/link.Lahey deleted file mode 100755 index d2e40ac0a..000000000 --- a/model/bin/link.Lahey +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Lahey lf95 compiler version 8.1 and up. # -# # -# Hendrik L. Tolman # -# July 2013 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=lf95 - else - comp=lf95 - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmpi" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Mpt b/model/bin/link.Mpt deleted file mode 100755 index 59e27936d..000000000 --- a/model/bin/link.Mpt +++ /dev/null @@ -1,198 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-O2 -o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp="ifort -lmpi" - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Mpt_debug b/model/bin/link.Mpt_debug deleted file mode 100755 index 4a51e7e43..000000000 --- a/model/bin/link.Mpt_debug +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 8.1 on a Pentium 4 # -# processor. # -# # -# Hendrik L. Tolman # -# April 2015 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt=" -p -pg -g -O0 -o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp="ifort -lmpi" - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.NEC b/model/bin/link.NEC deleted file mode 100755 index 87408b524..000000000 --- a/model/bin/link.NEC +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Link script for use in ad3 - Customised for compilation on the # -# NEC SX6/SX8 supercomputer using the sxf90 compiler # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# Hendrik L. Tolman # -# February 2005 # -# # -# Modification history: # -# # -# 05-Mar-2008 Modified original compile script for use on NEC. # -# (Chris Bunney, UK Met Office) # -# # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-f2003 -o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=sxmpif90 - else - comp=sxf90 - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - eval $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.Portland b/model/bin/link.Portland deleted file mode 100755 index 5bd265640..000000000 --- a/model/bin/link.Portland +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Portland Group compilers on x86_64. # -# # -# Hendrik L. Tolman # -# February 2005 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=pgf90 - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.SGI_Xeon_Intel b/model/bin/link.SGI_Xeon_Intel deleted file mode 100755 index 9aaf053c5..000000000 --- a/model/bin/link.SGI_Xeon_Intel +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for an SGI Altix Linux cluster with Dual-core Xeon # -# processors (Woodcrest 5160). The compiler is Intel Fortran 10.1.1008. # -# # -# Hendrik L. Tolman # -# Fabrice Ardhuin # -# February 2008 # - -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one -# -# options for fast executable on SGI Linux cluster with -# 3.0Ghz Intel Dual-core Xeon Processors(Woodcrest 5160) -# compiler used is Intel Fortran 10.1.1008 -# - libs="" - opt="-fast -o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpiifort - opt="-O3 -Zp8 -tpp7 -o $prog" - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.cray_xc.Intel b/model/bin/link.cray_xc.Intel deleted file mode 100755 index 59a37eb38..000000000 --- a/model/bin/link.cray_xc.Intel +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 12 on nehalem. # -# processor. # -# # -# Hendrik L. Tolman # -# February 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name - - opt="-o $prog" - opt="$opt -xHost -O3 -ip -fno-alias -fp-model strict -no-fma -ftz" - opt="$opt -i4 -real-size 32" - opt="$opt -traceback" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=ftn - else - comp=ftn - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp -openmp-report=1" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - if [ "$ncep_grib_compile" = 'yes' ] - then -# GRIB libraries for this one - opt="$opt -convert big_endian -assume byterecl -prec-div -prec-sqrt -ip" - libs="$libs ${G2_LIB4} ${W3NCO_LIB4} ${BACIO_LIB4} ${JASPER_LIB} ${PNG_LIB} ${Z_LIB}" - fi - -# netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.cray_xc.Portland b/model/bin/link.cray_xc.Portland deleted file mode 100755 index 1c4ad99b7..000000000 --- a/model/bin/link.cray_xc.Portland +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 12 on nehalem. # -# processor. # -# # -# Hendrik L. Tolman # -# February 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - opt="-o $prog" - opt="$opt -fastsse" - opt="$opt -i4 -r4" - opt="$opt -traceback" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=ftn - else - comp=ftn - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.cray_xt b/model/bin/link.cray_xt deleted file mode 100755 index e218b2932..000000000 --- a/model/bin/link.cray_xt +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Cray XT series. # -# # -# James D. Dykes # -# April 2010 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-o $prog" - - # seq implementation - comp=ftn - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.kubuntu.intel.mpich b/model/bin/link.kubuntu.intel.mpich deleted file mode 100755 index e357cfc50..000000000 --- a/model/bin/link.kubuntu.intel.mpich +++ /dev/null @@ -1,210 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the Intel ifort version 12 on nehalem. # -# processor. # -# # -# Hendrik L. Tolman # -# February 2012 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# Intel compiler ------------------------------------------------------------ -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - - - # linking options - libs="" - opt="-O3 -ip -o $prog" -# opt="-O3 -xSSE4.2 -ip -o $prog" -# opt="-O3 -prec-div -prec-sqrt -xHost -align array128byte -ip -o $prog" -# opt="-O0 -g -traceback -check all -fpe0 -ftrapuv -o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - which mpif90 1> /dev/null 2> /dev/null - OK=$? - if [ $OK != 0 ] - then - comp='ifort -lmpi' - fi -# opt="-O3 -o $prog" - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -openmp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.mac_pro_Intel b/model/bin/link.mac_pro_Intel deleted file mode 100755 index f74c1ca87..000000000 --- a/model/bin/link.mac_pro_Intel +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# # -# - This version is modified to work with the intel compiler on a mac pro. # -# NOTE: -g flag may result in link errors. Monte thinks this is a compiler # -# error. # -# # -# Hendrik L. Tolman # -# Monte Hanson # -# February 2008 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# 3.a Build options and determine compiler name -# No GRIB libraries for this one - - # linking options - libs="" - opt="-o $prog" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp=mpif90 - else - comp=ifort - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - opt="$opt -mp" - fi - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/model/bin/link.xlf b/model/bin/link.xlf deleted file mode 100755 index 712d8f54d..000000000 --- a/model/bin/link.xlf +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------------------- # -# link : Linker script for use in make (customized for hardware and # -# optimization. Note that this script will not be replaced if part # -# of WAVEWATCH III is re-installed. # -# # -# use : link name [name ... ] # -# name: name of source code file without the extension. # -# the first name will become the program name. # -# # -# error codes : all error output directly to screen. # -# # -# remarks : # -# # -# - Upon (first) installation of WAVEWATCH III the user needs to check the # -# following parts of this scripts : # -# sec. 3 : Provide correct link command # -# # -# - This version is made for the IBM xlf compiler version 8.1.1.6 # -# on an RS6000 SP wth power4 processors. # -# # -# Hendrik L. Tolman # -# February 2005 # -# --------------------------------------------------------------------------- # -# 1. Preparations # -# --------------------------------------------------------------------------- # -# 1.a Check and process input - - if [ "$#" -lt '1' ] - then - echo "usage: link name [name]" ; exit 1 - fi - - prog=$1 - echo " Linking $prog" - input="$*" - -# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv - main_dir=$WWATCH3_DIR - temp_dir=$WWATCH3_TMP - source=$WWATCH3_SOURCE - list=$WWATCH3_LIST - - -# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rm -f $main_dir/exe/$prog - -# --------------------------------------------------------------------------- # -# 2. Check objects # -# --------------------------------------------------------------------------- # - - cd $main_dir/obj - objects=$NULL - error='n' - set $input - - while [ "$#" -gt '0' ] - do - file=$1.o - if [ -f "$file" ] - then - objects="$objects $file" - else - echo " *** file $file not found ***" - error='y' - fi - shift - done - if [ "$error" = 'y' ] - then - echo "*** Missing object files ***" - exit 3 - fi - -# --------------------------------------------------------------------------- # -# 3. Link all things # -# --------------------------------------------------------------------------- # -# Add here the correct linker call including switches - -# IBM RS 6000 xlf ---------------------------------------------------------- -# 3.a Build options and determine compiler name -# Note GRIB libraries for this one - - libs="" - opt="-o $prog -O3 -qstrict -qarch=auto -qtune=auto -qcache=auto -qfloat=hsflt -qnosave" - -# debug=' -g -C -qcheck -qfltrap:enable -qsigtrap -qfullpath' - debug= - - opt="$opt$debug" - - comp="xlf90_r -q64" - - # mpi implementation - if [ "$mpi_mod" = 'yes' ] - then - comp="mpxlf90_r -q64" - fi - - # open mpi implementation - if [ "$omp_mod" = 'yes' ] - then - comp="xlf90_r -q64" - opt="$opt -qsmp=noauto" - fi - - case $prog in - 'ww3_grib' ) libs="-L /nwprod/lib -l w3_4 -l bacio_4" ;; - * ) libs= ;; - esac - - # oasis coupler archive - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] || \ - [ "$prog" = 'ww3_prnc' ] || [ "$prog" = 'ww3_prep' ] || [ "$prog" = 'ww3_prtide' ] || \ - [ "$prog" = 'ww3_gspl' ] - then - if [ "$oasis_mod" = 'yes' ] - then - if [ -z "$(env | grep OASISDIR)" ] - then - echo '' - echo "[ERROR] OASISDIR is not defined" - exit 1 - fi - echo "link with oasis" - libs="$libs $OASISDIR/lib/libpsmile.MPI1.a $OASISDIR/lib/libmct.a $OASISDIR/lib/libmpeu.a $OASISDIR/lib/libscrip.a" - fi - fi - - # netcdf library dir - if [ "$netcdf_compile" = 'yes' ] - then - case $WWATCH3_NETCDF in - NC3) libs="$libs -L$NETCDF_LIBDIR -lnetcdf" ;; - NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi - libs="$libs `$NETCDF_CONFIG --flibs`" ;; - esac - fi - - # parmetis library - if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] - then - if [ "$pdlib_mod" = 'yes' ] - then - if [ -z "$(env | grep METIS_PATH)" ] - then - echo '' - echo "[ERROR] METIS_PATH is not defined" - exit 1 - fi - echo "link with parmetis" - libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a" - fi - fi - - opt="$opt $EXTRA_LINK_OPTIONS" - -# 3.b Link - - rprfx="-Wl,-rpath," - rpath= - for path in $libs - do - if [ "${path:0:2}" = '-L' ] - then - rpath="$rpath ${rprfx}${path//-L/}" - fi - done - - $comp $opt $objects $libs $rpath > link.out 2> link.err - OK="$?" - -# --------------------------------------------------------------------------- # -# 4. Postprocessing # -# --------------------------------------------------------------------------- # - - if [ "$OK" != '0' ] - then - echo " *** error in linking ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - rm -f $prog - exit $OK - else - if [ ! -f $prog ] - then - echo " *** program $prog not found ***" - echo ' ' - cat link.out - echo ' ' - cat link.err - echo ' ' - rm -f link.??? - exit 1 - else - mv $prog $main_dir/exe/. - rm -f link.??? - fi - fi - -# end of link --------------------------------------------------------------- # diff --git a/regtests/ww3_tp2.17/input/.ww3_multi_grdset_aa.inp.swp b/regtests/ww3_tp2.17/input/.ww3_multi_grdset_aa.inp.swp deleted file mode 100644 index 6eeb7a6015a3ad5f0015568120d83034a05123a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeHN-)kdP6uv9#uhsp5`z##SVp`oKlce3<7DZ~Cb^~r&lk8UUq26R}+M$z~ICs)) zAN+x!zAcFO4~U@nBDjy@n}2|)Ac7AfEC_=7DEs7h?o5(tx0Tg5@eX{MnLBgOJ@-4` zId@8L+qqV|LKh3O0>>F4e!hL`-wpTO_HSHP#h zyTIGPYd{0I3_J>)0d9edZ-GyM_ks6-w}3Z+>%cC+d`Z9_mI2FvW#DKArl=aY6n4pM zRiZAoG>Iuelxw!ubIDb_tu|HQ=7=2AKn~5%&r@l9UcviRcAR-zB&ZUGKZm)nzbAX%m z&RQjruaxma4S8-lFAN1B2A@&e|Zxt}=?$s{>4my1v}f+X5MR>G|& ziPnI4H=5p7KJPdyBy+iYcjAzw@6%S~xf-2mDGYXboG_3+h5P(CbUdOB5B=MUWWVow z%1s=g7PVjv#|oUMZWvKd>K*o7#?+6%0gO}Z^%ReK*n6F@2NEQ^!n2HrVSXt0C;%gD z2IFwQJ7$`;OejD4opMHXP1cTa56OaD;7j&S8{d&2XpFr`Q7?3rPthPS6U})+015B} zazU6I{lM#8#dqV2$unHRB|>&VWza~8e~2?I2TJ~pF<3fiEFp*8!ok5UP_0XGG*IV> zC&N|1P+7RLwp?2#Pt%sdOk}LwG$5tQ4EmbzWu@m1dVMAb1*M&2>Yhn*8ffKGdk^M4 z$lDBTe$42mp;XG3$}_aAx?TVmka{M#u!LCm27%X+F@!SRkHU`9TIrd@D68k7)kp?A z8X2Oo>yqW+dfl#y5F^Ys9P}v|^x7&il7<&0hv%}Ic|y~Wpo*Y!e-CD)*4|ct3Fr_* zL84=O=~U*~Km&uOmU;d>vwe1S7=b^MkkG{BOvF>;YBp`(4iZJJ#)orjMSKh z&^BGwO>Y0rh>0NLiyUE@UYET-g4qy82;S3Ro73 zE~T{?aq$9EBG8zQY3NTZl=GJ$msIE6&%B~DDUz_O5%72$R>xkX9+X&Znf@je=G`R3 zu?jTTMTn3aQmGiSc*1=d$)19|IT4{ms0%Tbq~S88;dA5@YJo0@c^*RlJfg%AXD<<{BDFo(Qg-4y~Zxt)OIbmANo8Sz_1`O?n$&4{*R$ zE>{!`m9Assx{`=uF4J@JZu*ib`-i!j^qrjz#y0O?=x=giNjm-A=yzWQ{aO5t&ME?SfbXvUt