The CMS is a multiscale stochastic Lagrangian framework developed by Paris' Lab at the Rosenstiel School of Marine, Atmospheric & Earth Science to study complex behaviors, giving probabilistic estimates of dispersion, connectivity, fate of pollutants, and other Lagrangian phenomena. This repository facilitates community contributions to CMS modules
I believe the current code in mod_reef.f90 doesn't account for any polygons that cross the GMT meridian. I have tried multiple formats of coordinates but if you have a box that starts at -0.5Deg East (359.5deg) in the western extent and extends to 0.5 Deg east in the eastern extent, it looks like CMS decides the box goes from the east to the west around the world instead of the intended west to east.
...
e.g. Here is my example polygon (from top left>top right>bottom right>bottom left)- roughly 50km square around a Spanish coastal release location (also tried with 5th coordinate back at the start, and with longitudes in 360 format).
See attached pdf for e.g. trajectories in this simulation, exemplifying that this polygon has been interpreted as a band around the world extending out beyond Italy, around the world, and back through Portuguese waters to Spain. (the con file shows connections from Italy, Morocco, and Portugal which tracks do not suggest to be true)
...
Apologies for not being good enough at Fortran to suggest a solution, but it looks like you need to tell CMS that 350-something, could come before 1. Perhaps there needs to be a standard where polygons must be interpreted from east to west and back, or where values less than 10 and over 350 are found the 350s are interpreted into minus numbers (the -180/180deg format) instead? Or perhaps there could be a runconf.list entry where you opt to work on 0-360 or -180to180 scale dependent upon the longitude range you want to centre?
I believe the current code in mod_reef.f90 doesn't account for any polygons that cross the GMT meridian. I have tried multiple formats of coordinates but if you have a box that starts at -0.5Deg East (359.5deg) in the western extent and extends to 0.5 Deg east in the eastern extent, it looks like CMS decides the box goes from the east to the west around the world instead of the intended west to east. ... e.g. Here is my example polygon (from top left>top right>bottom right>bottom left)- roughly 50km square around a Spanish coastal release location (also tried with 5th coordinate back at the start, and with longitudes in 360 format).
-0.81517885497 39.58398313240 8 0.30245816118 39.71128726480 8 0.45953581914 38.79684471190 8 -0.64123030184 38.67112556320 8
See attached pdf for e.g. trajectories in this simulation, exemplifying that this polygon has been interpreted as a band around the world extending out beyond Italy, around the world, and back through Portuguese waters to Spain. (the con file shows connections from Italy, Morocco, and Portugal which tracks do not suggest to be true) ... Apologies for not being good enough at Fortran to suggest a solution, but it looks like you need to tell CMS that 350-something, could come before 1. Perhaps there needs to be a standard where polygons must be interpreted from east to west and back, or where values less than 10 and over 350 are found the 350s are interpreted into minus numbers (the -180/180deg format) instead? Or perhaps there could be a runconf.list entry where you opt to work on 0-360 or -180to180 scale dependent upon the longitude range you want to centre?
All the best, Bex
plot_bad_polygon_meridian.pdf