Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCS ROMS #783

Open
MireyaMMO opened this issue Nov 30, 2021 · 6 comments
Open

LCS ROMS #783

MireyaMMO opened this issue Nov 30, 2021 · 6 comments

Comments

@MireyaMMO
Copy link

MireyaMMO commented Nov 30, 2021

Hi!
I've been testing the backtracking LCS script on a ROMS grid, at first I struggled because the fake projection (due to the lack of projection from ROMS) wasn't transforming correctly. That was fixed creating my own projection and adding it to the reader, but something is still off because I'm still getting data over masked locations. Do you mind sharing any suggestions?

This is a 7-day backtrack simulation on a 1 km resolution grid
LCStest

@knutfrode
Copy link
Collaborator

knutfrode commented Nov 30, 2021 via email

@MireyaMMO
Copy link
Author

MireyaMMO commented Nov 30, 2021

Thank you very much for taking time to reply!
So far I believe I've done this. As extra information this is the configuration I've set regarding the mask
o.set_config('seed:ocean_only',True)
o.set_config('environment:fallback:land_binary_mask', 0)
I also tried adding one reader just for the mask but got the same result.

According to the log, It's loading from the ROMS reader and moving the points that are considered to be land so this tells me the mask is being read correctly.

10:15:26 DEBUG opendrift.models.basemodel: Preparing roms native
10:15:26 DEBUG opendrift.readers.basereader: Nothing more to prepare for roms native
10:15:26 INFO opendrift.models.basemodel: Using existing reader for land_binary_mask
10:15:26 DEBUG opendrift.models.basemodel: ----------------------------------------
10:15:26 DEBUG opendrift.models.basemodel: Variable group ['land_binary_mask']
10:15:26 DEBUG opendrift.models.basemodel: ----------------------------------------
10:15:26 DEBUG opendrift.models.basemodel: Calling reader roms native
10:15:26 DEBUG opendrift.models.basemodel: ----------------------------------------
10:15:26 INFO opendrift.models.basemodel: Moving 10381 out of 123380 points from land to water

And also it seems like it's masking values that are stranding

10:24:01 DEBUG opendrift.models.basemodel: Using fallback value 0.0 for land_binary_mask for 31888 elements
10:24:01 DEBUG opendrift.models.basemodel: ------------ SUMMARY -------------
10:24:01 DEBUG opendrift.models.basemodel: land_binary_mask: 0 (min) 1 (max)
10:24:01 DEBUG opendrift.models.basemodel: ---------------------------------

If I print the reader I have two variables of land_binary_mask, don't know if that could be an issue and if it is not sure of how to delete one.

print(reader)
Reader: roms native
Projection:
None
Coverage: [pixels]
xmin: 0.000000 xmax: 399.000000 step: 1 numx: 400
ymin: 0.000000 ymax: 314.000000 step: 1 numy: 315
Corners (lon, lat):
(175.70, -35.27) (180.25, -35.27)
(175.70, -38.06) (180.25, -38.06)
Vertical levels [sigma]:
[-0.98494898 -0.95515306 -0.92576531 -0.89678571 -0.86821429 -0.84005102
-0.81229592 -0.78494898 -0.7580102 -0.73147959 -0.70535714 -0.67964286
-0.65433673 -0.62943878 -0.60494898 -0.58086735 -0.55719388 -0.53392857
-0.51107143 -0.48862245 -0.46658163 -0.44494898 -0.42372449 -0.40290816
-0.3825 -0.3625 -0.34290816 -0.32372449 -0.30494898 -0.28658163
-0.26862245 -0.25107143 -0.23392857 -0.21719388 -0.20086735 -0.18494898
-0.16943878 -0.15433673 -0.13964286 -0.12535714 -0.11147959 -0.0980102
-0.08494898 -0.07229592 -0.06005102 -0.04821429 -0.03678571 -0.02576531
-0.01515306 -0.00494898]
Available time range:
start: 2020-10-01 00:00:00 end: 2020-11-01 00:00:00 step: 1:00:00
745 times (0 missing)
Variables:
sea_floor_depth_below_sea_level
land_binary_mask
land_binary_mask
sea_surface_height
x_sea_water_velocity
y_sea_water_velocity
upward_sea_water_velocity
sea_water_temperature
sea_water_salinity
surface_downward_x_stress
surface_downward_y_stress

0:03:46.0 total
0:00:00.7 preparing
0:02:29.5 reading
0:00:54.3 interpolation
0:00:00.5 interpolation_time
0:00:01.8 masking
0:01:13.5 rotating vectors

Also I tried to plot the reader using reader.plot('land_binary_mask') but I got an error due to the projection

Thank you again

*Adding the image again to show the reader's coastline
LCStest3

@knutfrode
Copy link
Collaborator

if reader.plot() does not work, it could indicate that your code is slightly outdated.
Could you try to update your code (git pull) and also the dependencies with:

conda env update -f environment.yml
pip install -e .

It might not solve the problem, but would be useful to see the plot of landmask.

@MireyaMMO
Copy link
Author

Thanks! I updated everything, still having error but it's because I'm working in a New Zealand domain and the program has problems with the limits of 180.5, still I worked a little bit around it and managed to get the plot going
landmask
landmask2

@knutfrode
Copy link
Collaborator

Yes, I believe the ROMS reader is less robust than reader_netCDF_CF_generic regarding dateline problems.

Anyway, is there a particular reason for adding this line?
o.set_config('environment:fallback:land_binary_mask', 0)
Can you try without this?

It is not quite clear to me what is the problem, is it that you get LCS-values calculated over land come places?
Could this be particles "jumping" into the land during the a time step (which should preferably not be greater than 30 minutes here.
But it also seems that you have missing data (white area) over sea here?

@MireyaMMO
Copy link
Author

From my understanding that line means that outside the domain there's ocean (might be wrong), this is a nested domain, so that's why I added it. I did some tests without it but it still shows data on land.

LCStest30m2

Yes that's the problem. I think it's a big area of in land particles, considering the 1 km resolution grid initially given, (another time period given below). I did try a smaller time-step. There's no noticeable difference between 15 minute time-step and a 30 minute time-step, in terms of the gap over sea and the data in land.

LCStest30Jul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants