Position of runoff

Dear CROCO members,

I am trying to add some rivers into a tropical Atlantic configuration. I downloaded the croco_tools-master on 1/10/2021 (croco-ocean / croco_tools Β· GitLab)

I read the documentation and used the make_runoff.m script to generate a climatological flow/salinity input file.
I understood that the position indexes (Isrc and Jsrc) are specified in the u/v grid for horizontal/meridional flow, respectively. The outputs of locate_runoff.m, I2(:slight_smile: and J2(:), are indeed the coastline positions in u or v grids, depending on the direction (E->W, W->E, S->N, N->S) of the flow.

These positions are ready to be written in the croco_runoff.nc, but not yet used. As far as I unserstood, I have to copy the text output at the end of the execution of make_runoff in my croco.in.

-----> I do not understand why, when listing the position in make_runoff.m, these indices are modified (I2-1 for meridional flow and J2-1 for zonal flow):

if dir(k,1) == 1 %%flow meridien

disp([’ β€˜,num2str(I2(k)-1),’ ',num2str(J2(k)),…

’ β€˜,num2str(dir(k,1)),’ β€˜,num2str(dir(k,2)),’ 30T β€˜,…

num2str(T),’ β€˜,num2str(S)])

elseif dir(k,1) == 0 %flow zonal

disp([’ β€˜,num2str(I2(k)),’ ',num2str(J2(k)-1),…

’ β€˜,num2str(dir(k,1)),’ β€˜,num2str(dir(k,2)),’ 30
T β€˜,…

num2str(T),’ ',num2str(S)])

end



Note that I slightly modified the figures generated by make_runoff.

  1. In the big map with all the rivers, pcolor does not plot the land/sea mask cell centered around the lon/lat position of each cell. I suggest shifting the axes by dl/2 (just for the drawing): m_pcolor(lon-dl/2,lat-dl/2,mask)
  2. When continuing plotting the big map, the adjusted position of the rivers, I2 and J2, should be plotted using the lonu/latu or lonv/latv grids (and not the rho grid), such that:

    for k0=1:number_rivertoprocess

    k=rivertoprocess(k0);

    if dir(k,1)==0 %zonal flow (u-grid)

    lon_src=lonu(J2(k),I2(k));

    lat_src=latu(J2(k),I2(k));

    else

    lon_src=lonv(J2(k),I2(k));

    lat_src=latv(J2(k),I2(k));

    end

    [px,py]=m_ll2xy(lon_src,lat_src);

    if dir(k,1)==0 & dir(k,2)==1

    h3=plot(px,py,β€˜k>’);

    elseif dir(k,1)==0 & dir(k,2)==-1

    h3=plot(px,py,β€˜k<’);

    elseif dir(k,1)==1 & dir(k,2)==1

    h3=plot(px,py,β€˜k^’);

    elseif dir(k,1)==1 & dir(k,2)==-1

    h3=plot(px,py,β€˜kv’);

    end

    set(h3,β€˜Clipping’,β€˜off’)

    end



    Thanks in advance for your answer

    Serena