Sustainable-Aquafeeds-Project / feed_biodiv_impact_mapping

This repository holds the code used to support Clawson et al ... <Final manuscript reference to be inserted>
https://sustainableaquafeedsproject.org/
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

FMFO allocation and trade data #6

Closed gclawson1 closed 1 year ago

gclawson1 commented 1 year ago

Starting this issue to document my progress on FMFO allocation.

So far, I've used similar methods to what was done for the food footprint paper, using Watson catch data and FMFO trade data (provided by Jessica). I believe I now have rasters that represent the tonnes of forage fish catch that go to fish oil OR fish meal under a "plant-dominant" and "fish-dominant" aquafeed diet (see maps below). If what I've done is correct, then I need to figure out a way to allocate the production (or split it) in these rasters to separate rasters of fish oil AND fish meal. See below for details.

Summary:

  1. Calculate tonnes of consumption using FCRs (same as Rich's pressure paper) and two different diets; plant-dominant (Aas et al. 2022) and fish-dominant (same as Rich's pressure paper).
  2. Determine likely country (or location in ocean) where feed originates using global trade data and Watson data. This is the complicated part:

Jessica provided a data file for the food footprint project, named FMFO_bySource.csv. This data set shows the total forage fish from each country's landings that goes to FMFO feed for each animal system (e.g., this is our "trade data". We only care about salmon). From the SI material:

For marine fisheries, we determine the likely country of origin for fish used in animal feed by comparing domestic landings to imported and exported fish meal (under the HS Code 230120), converted to the live weight equivalent. Trade data come from the UN Comtrade for the year 2015. Since this method only traces sourcing back one country step (i.e., does not consider reexportation or foreign processing), we treated both imports and landings minus exports as being consumed within a given country. This then allowed us to calculate the proportion of forage fish sourced domestically versus from each exporting country. Finally, we multiplied each country-production system pair’s forage fish use by the proportion coming from each exporter and domestic landings. This then allowed us to compute the total forage fish coming from each country’s landings that go to feed for each animal food system.

Then we do this:

For each country, we then calculate the proportion of forage fish going to animal food systems by dividing the tonnes of forage fish fed to each animal food system (calculated above) by each country’s total landings calculated using the country of the fishing vessel, regardless of the location the fish were caught.

At this point, I could take the proportions calculated above, and multiply them by Watson rasters that show the tonnes of forage fish caught. This would give us the "real world" (based on trade and watson catch data) amount of forage fish catch that is going to FMFO.

Because we want the forage fish catch used for FOFM under each diet scenario, we need to figure out the amount of forage fish catch used for fofm that is missing from the "real world" scenario (provided by Jessica) under each diet scenario. This "missing catch" will be assigned to global catch proportional to total forage fish catch. I'm not sure if this part is correct, because the demand we are comparing to is presumably in the units of fish oil or fish meal. So we will need to convert that to fish weight first? This would be the allocation part, no? Regardless, I think the method is still viable if we fix that problem.

Basically, we need to calculate the amount of fofm catch under each diet scenario that isn't represented in the "real world" catch, and add that to our total. We'll just assume the location of catch stays the same, but the magnitude increases or decreases based on diet scenario. Does that make sense??... see code:

# total fofm catch:
forage_tonnes <- sum(foragefish_rgn_totals$FOFM_catch) # 21414954 

# total system consumption:
system_consumption <- read_csv(here("prep/02_feed/data/demand/total_global_ingredient_demand.csv")) %>%
  filter(ingredient %in% c("fish meal, forage fish", "fish oil, forage fish")) %>%
  mutate(system = "salmon_aquaculture_meat") %>%
  group_by(system, diet) %>%
  summarize(total_feed_diet = sum(total_ingredient_demand, na.rm=TRUE)) %>%
  filter(!is.na(system))

# # A tibble: 2 × 3
# # Groups:   system [1]
#   system                  diet           total_feed_diet
#   <chr>                   <chr>                    <dbl>
# 1 salmon_aquaculture_meat fish-dominant         1982499. # yeah.. this needs to be adjusted to fish weight, this is too low. 
# 2 salmon_aquaculture_meat plant-dominant         616377.

loss <- FOFM_props_limit %>%
  rowwise() %>%
  mutate(est_tonnes = FOFM_catch*prop) %>%
  group_by(system) %>%
  summarize(est_feed = sum(est_tonnes)) %>%
  left_join(system_consumption, by="system") %>%
  mutate(prop_accounted_for = est_feed/total_feed_diet) %>% # 99% accounted for in fish diet, 3x more accounted for in plant diet. These will change once we convert ingredients to fish weight. 
  mutate(loss = total_feed_diet - est_feed) %>%
  mutate(forage_tonnes = forage_tonnes) %>%
  mutate(prop_of_global_distribute = loss/forage_tonnes)

loss

# # A tibble: 2 × 8
#   system                  est_feed diet           total_feed_diet prop_accounted_for      loss forage_tonnes prop_of_global_distribute
#   <chr>                      <dbl> <chr>                    <dbl>              <dbl>     <dbl>         <dbl>                     <dbl>
# 1 salmon_aquaculture_meat 1976716. fish-dominant         1982499.              0.997     5783.     21414954.                  0.000270
# 2 salmon_aquaculture_meat 1976716. plant-dominant         616377.              3.21  -1360339.     21414954.                 -0.0635 

## so need to add 0.000270 of global total to each cell in fish dominant and subract -0.0635 of global total from each cell in plant dominant

Next I create rasters describing the amount of each country's forage fish catch going to fofm feed for salmon aquaculture for each diet scenario (code provided below):


systems <- loss$system

diets <- unique(loss$diet)

system_item = unique(systems)

for(diet_type in diets){
# diet_type = "plant-dominant"

  watson_raster_template <- raster::raster(ncol=720, nrow=360, vals=c(1:259200))

  system_prop <- FOFM_props_limit %>%
  dplyr::filter(system == system_item) %>%
  dplyr::select(iso3c, prop)

system_extra_prop_diet <- filter(loss, system == system_item, diet == diet_type) %>%
  pull(prop_of_global_distribute)

foragefish_system <- left_join(foragefish, system_prop, by="iso3c") %>%
  mutate(prop = ifelse(is.na(prop), 0, prop)) %>% ## fix NAs
  mutate(system_extra_prop_diet = system_extra_prop_diet) %>%
  mutate(FOFM_catch_foodsystem_ID = FOFM_catch * prop) %>% ## "real world" forage fish catch to fofm feed
  mutate(FOFM_catch_foodsystem_xtra = FOFM_catch * system_extra_prop_diet) %>% ## extra forage fish catch to fofm feed that is missing in each diet
  mutate(FOFM_catch_foodsystem = FOFM_catch_foodsystem_ID + FOFM_catch_foodsystem_xtra) %>% ## add that together to get forage fish catch to fofm under each diet in each cell 
  group_by(Cell) %>%
  summarize(tonnes = sum(FOFM_catch_foodsystem, na.rm=TRUE))

forage_fish_system <- raster::subs(watson_raster_template, foragefish_system, by = "Cell", which = "tonnes", subsWithNA=TRUE)

# plot(log(forage_fish_system + 1))

# the following should be about equal
print(sprintf("the following should be about equal for: %s", system_item))
print(sprintf("raster calc: %s", cellStats(forage_fish_system, "sum", na.rm=TRUE))) 
print(sprintf("observed: %s", filter(loss, system==system_item, diet == diet_type) %>% pull(total_feed_diet)))

writeRaster(forage_fish_system, sprintf(here("prep/02_feed/output/%s/forage_fish/forage_fish_tonnes_feed_%s.tif"), diet_type, diet_type) , overwrite=TRUE)
}

image

image

Having trouble with the plant-dominant one because the way I've coded it is assigning some cells negative catch, so I will need to fix that if the plant-dominant diet ends up having less FOFM forage fish catch than "real life" after allocation.

If this workflow seems suitable, and after I fix the units (using raw fish material rather than ingredients) I need to figure out how to split (or allocate) these rasters into fish oil and fish meal rasters (right now FMFO is just combined into one raster for each diet).

For now, I'm going to wait to move forward, and take a look at what @cottrellr did for the pressure paper and how he allocated and made fofm rasters. Maybe we can chat about this in our meeting today @cottrellr ?

gclawson1 commented 1 year ago

Ok... updated the above with our allocation approaches (mass and energetic) to convert the fish oil and fish meal demand into raw material (fish weight) units.

I used the global average values (see below) that @cottrellr put together in Feed mapping/data/allocation/embodied_fish_allocation.xlsx

image

And I applied these values to the total global demand of fish oil and fish meal, to convert ingredients (fish oil or fish meal) to raw materials (forage fish) and I applied the methods I outlined above.

Plant-dominant diet; logged forage fish catch going to fish oil or fish meal: image

Fish-dominant diet; logged forage fish catch going to fish oil or fish meal: image

Now, provided this workflow is right, I need to determine how to split the produced rasters from one singular "fofm" raster, into a fish meal raster and a fish oil raster. Perhaps by the proportion of demand for each ingredient or raw material?

cottrellr commented 1 year ago

I have to look into the steps you have outlined here a little, (will try to do before we meet) but yeah the allocation measures are how we split fo and fm.

Sent from my iPhone

On 18 May 2023, at 9:21 am, Gage Clawson @.***> wrote:



Ok... updated the above with our allocation approaches (mass and energetic).

I used the global average values (see below) that @cottrellrhttps://github.com/cottrellr put together in Feed mapping/data/allocation/embodied_fish_allocation.xlsx

image.png (view on web)https://github.com/Sustainable-Aquafeeds-Project/feed_biodiv_impact_mapping/assets/33332753/c748c5ba-03dc-4dad-9ff2-6c744254e524

And I applied these values to the total global demand of fish oil and fish meal, to convert ingredients (fish oil or fish meal) to raw materials (forage fish) and I applied the methods I outlined above.

Plant-dominant diet; logged forage fish catch going to fish oil or fish meal: image.png (view on web)https://github.com/Sustainable-Aquafeeds-Project/feed_biodiv_impact_mapping/assets/33332753/4b8413e1-6347-4c63-8baf-9c84e269ad95

Fish-dominant diet; logged forage fish catch going to fish oil or fish meal: image.png (view on web)https://github.com/Sustainable-Aquafeeds-Project/feed_biodiv_impact_mapping/assets/33332753/bd18ac99-711b-4358-83dd-0612e5858805

Now, provided this workflow is right, I need to determine how to split the produced rasters from one singular "fofm" raster, into a fish meal raster and a fish oil raster. Perhaps by the proportion of demand for each ingredient or raw material?

— Reply to this email directly, view it on GitHubhttps://github.com/Sustainable-Aquafeeds-Project/feed_biodiv_impact_mapping/issues/6#issuecomment-1552205703, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJK3YJARAVA23IQVT3VDIVTXGVMNLANCNFSM6AAAAAAYFV2UOA. You are receiving this because you were mentioned.Message ID: @.***>

This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

gclawson1 commented 1 year ago

The other day we discussed how to improve the above methods by accounting for species specific allocation rates.

I've been considering how to accomplish this. If this is way off base, please let me know.. I've been thinking about this too much.

Possible approach

I think this is the approach that makes more sense...

  1. Start with demand per country

    • EX: NOR requires X tonnes of FO
  2. Get trade data for FO and FM and match to demand data. Figure out how much countries import FO or FM from other countries.

    • EX: NOR imports Y% of FO from USA, Z% from Peru, etc.
  3. Multiply the import %s by the demand tonnes to get ingredient tonnes imported per country

    • EX: NOR requires 100 tonnes of FO, they import 60% from the USA, then 60 tonnes of FO ingredients in NOR comes from the USA for salmon.
  4. Group by exporter country to get total amount of FO or FM ingredients they export under each diet demand scenario

    • EX: USA exports 60 tonnes to NOR, 40 tonnes to CHL, then they export 100 tonnes of FO total for salmon feed.
  5. Determine each countries' breakdown of forage fish species catch by flag country (e.g., where the catch is actually landed, rather than caught). Filter for all forage fish species, group by country and species, and determine the within-country proportions of catch from each species. For example, 55% of the forage fish species weight that USA lands is from Gulf Menhaden, 24% from Atlantic Menhaden, 8% from Atka mackerel, etc...

  6. Apply these within country percentages to total country exported fish oil and fish meal (calculated in step 4). Now we will have X tonnes of fish oil and Y tonnes of fish meal exported from or kept within country Z per fish species per diet scenario.

    • For example, if 55% of the forage catch in USA is from Gulf Menhaden, then 55% of the fish meal (and 55% of the fish oil) exported from or kept in USA will be attributed to Gulf Menhaden.
  7. Next, we can use the species specific allocation rates that Rich put together to convert the fish oil and fish meal to raw material live weight equivalents. Now we have total tonnes of fish oil and fish meal live weight equivalents per landing country per species.

  8. Divide the tonnes of fish oil and fish meal live weight equivalents by the total amount of forage catch in each country. This gives us a proportion of forage fish catch in each country that goes to FMFO.

  9. Join with Watson data, group by cell, and rasterize? Now we will have rasters describing the amount of forage fish catch that goes to fish oil or fish meal for salmon feed under each diet scenario under each allocation approach (mass or energetic).

gclawson1 commented 1 year ago

Ok, I moved forward with the 2nd approach and coded up everything. I've managed to produce the rasters for each ingredient, allocation type, and diet. However, there are countries missing from the UN Comtrade data, so I need to figure out what is going on there... probably a mistake I made somewhere.

gclawson1 commented 1 year ago

Ok.. I've sorted out the problem with the missing countries!

gclawson1 commented 1 year ago

Provided what I've done makes sense here are the results:

Plant-dominant diet scenario (logged):

image

Fish-dominant diet scenario (logged):

image

gclawson1 commented 1 year ago

Updated to include krill for fish meal

Plant dominant scenario (logged): image

Fish dominant scenario (logged): image

gclawson1 commented 1 year ago

Updated to use BACI trade data, since this is what Jessica uses. It is derived from COMTRADE, but reports the bilateral trade flows instead of multilateral like COMTRADE, so it is simpler to prep (and somehow it includes a few missing countries that the COMTRADE data didn't have for me!): http://www.cepii.fr/DATA_DOWNLOAD/baci/doc/DescriptionBACI.html

cottrellr commented 1 year ago

Sounds like a good plan!

Sent from my iPhone

On 3 Jun 2023, at 4:57 am, Gage Clawson @.***> wrote:



Updated to use BACI trade data, since this is what Jessica uses. It is derived from COMTRADE, but reports the bilateral trade flows instead of multilateral like COMTRADE, so it is simpler to prep (and somehow it includes a few missing countries that the COMTRADE data didn't have for me!): http://www.cepii.fr/DATA_DOWNLOAD/baci/doc/DescriptionBACI.htmlhttp://www.cepii.fr/DATA_DOWNLOAD/baci/doc/DescriptionBACI.html

— Reply to this email directly, view it on GitHubhttps://github.com/Sustainable-Aquafeeds-Project/feed_biodiv_impact_mapping/issues/6#issuecomment-1574177374, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJK3YJFWUQUVZPZ4B3Z2BYLXJIZPXANCNFSM6AAAAAAYFV2UOA. You are receiving this because you were mentioned.Message ID: @.***>

This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

gclawson1 commented 1 year ago

Note to self: Currently using 2017 trade data for both fofm and crops. Consider using an average over years to account for changes in trade since it is somewhat finicky. Maybe do 5 years before 2020 (excluding 2020), since covid screwed things.

cottrellr commented 1 year ago

Agreed this is a good shout. It’s less about specific annual trends but average patterns of trade and production.


Richard S. Cottrell Research Fellow in Aquaculture Sustainability Institute for Marine and Antarctic Studies College of Sciences and Engineering University of Tasmania

Theme Co-Lead, Sustainable Futures and Planetary Health Centre for Marine Socioecology University of Tasmania

Size Ecology Labhttps://www.sizeecology.org/ | Centre for Marine Socioecologyhttps://marinesocioecology.org/themes/sustainable-futures-and-planetary-health/ Google Scholarhttps://scholar.google.com/citations?user=1pLCMKIAAAAJ&hl=en | ORCIDhttps://orcid.org/my-orcid?orcid=0000-0002-6499-7503 | @RichCottrell22https://twitter.com/RichCottrell22

On 6 Jun 2023, at 2:45 am, Gage Clawson @.**@.>> wrote:

Note to self: Currently using 2017 trade data for both fofm and crops. Consider using an average over years to account for changes in trade since it is somewhat finicky. Maybe do 5 years before 2020 (excluding 2020), since covid screwed things.

— Reply to this email directly, view it on GitHubhttps://github.com/Sustainable-Aquafeeds-Project/feed_biodiv_impact_mapping/issues/6#issuecomment-1577133327, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJK3YJAFNKOSDTRO237LWRDXJYEJ3ANCNFSM6AAAAAAYFV2UOA. You are receiving this because you were mentioned.Message ID: @.***>

This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

gclawson1 commented 1 year ago

Chatted with Jessica yesterday about this approach. She said this is the approach she used for the global food footprint paper and the trade of fish meal in that. Using the HS codes I've used already is correct.

However, there are a few minor potential problems with this approach:

Potential solution:

We could use Jessica’s data for fish meal (eventually, when it is published, or possibly before, if we ask her). However, since she doesn't have information on fish oil, does it even make sense to use her data? We would be using one method for fish meal (Jessica's data), and a different one for fish oil (current method). I think it makes more sense to keep the methods consistent and acknowledge the possible overestimation in places like Denmark and Iceland, that import forage fisheries and process in country, since Jessica doesn't have data for fish oil.

gclawson1 commented 1 year ago

Chatted with Jessica yesterday about this approach. She said this is the approach she used for the global food footprint paper and the trade of fish meal in that. Using the HS codes I've used already is correct.

However, there are a few minor potential problems with this approach:

  • This approach will overestimate fish meal exports in some places because the BACI trade data may include intermediaries that import forage fish, process it into fish meal, and then export it. An example of this is Denmark. Denmark imports fish from Western Africa, processes it in Denmark, then exports to Norway. However, the BACI trade data only indicates that Denmark is exporting data to Norway. So, under our approach we would be over estimating exports from Denmark, and underestimating from Western Africa. However, Jessica said that nearly all of the time landings are processed into to fish meal in the landing country, so this example is rare.

    • This is why Jessica's data will be so useful. This problem is what they've spent years figuring out and coding into her trade database.
  • She also mentioned that there is potential for double counting when including a similar workflow for fish oil, since sometimes fish meal is created without fish oil as a co-product. This is why her trade data only shows fish meal. Is this problem solved with our allocations?

Potential solution:

We could use Jessica’s data for fish meal (eventually, when it is published, or possibly before, if we ask her). However, since she doesn't have information on fish oil, does it even make sense to use her data? We would be using one method for fish meal (Jessica's data), and a different one for fish oil (current method). I think it makes more sense to keep the methods consistent and acknowledge the possible overestimation in places like Denmark and Iceland, that import forage fisheries and process in country, since Jessica doesn't have data for fish oil.

Forgot to bring this up for discussion yesterday @cottrellr, what do you think?

cottrellr commented 1 year ago

Cool, this is a good discussion point.

Yes I agree, Jessica's data is going to be super useful going forward but I think it's not crazy problematic to not have it right now - it'll be published for use in future papers I'm sure and I know she has been inundated for requests for her data so there could be some delays there. We also won't have the same luxury for agricultural products so having a consistent approach across ingredients is a good thing.

Re the intermediary countries for FMFO - we could get a list of these potential countries (Denmark, Iceland, any others) and then look at where they get theirs and distribute evenly across these trade partners? I assume the fishmeal and oil from these intermediary places could be market mixes of species and probably a high and lower quality variety. If this is only a few countries then perhaps that is doable. From what Biomar say too, most FMFO is processed near to where it is landed, so maybe this shouldn't be so many countries.

I'm not convinced that there is a double counting risk. I'm not sure what she means by fishmeal created without fish oil - typically even for non-oily fish used in trimmings there tends to be an oil component (like cod which is ~1-2% oil yield) - whether or not it is wasted and then not traded is another matter. I'm guessing this is what she means like groundfish processed for Chinese aquaculture. Either way, we have a quantity of meal and a quantity of oil that we know we want traded to meet demands for salmon. Depending on where it is exported from we can then allocate to embodied fish based on our conversion factors and where we know trimmings are coming from and the proportion based on the fishing area. I think where double counting could be problematic using two codes is if we were to be trying to achieve mass balance between all global forage fish production, trade and consumption. But given we are looking at just salmon and very specific demand for FMFO that should fall easily within total trade flows, I think it is fine.

So I agree with your suggestion to keep methods consistent and acknowledge the possible sourcing issues or address just those countries by looking at their (e.g. Denmark's) bilateral trade to see where it was likely landed.