Skip to content

map river nutrients to blom mesh using rof->ocn mapping files #583

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mvertens
Copy link
Contributor

@mvertens mvertens commented May 25, 2025

This PR implements mapping river nutrients on a 0.5 x 0.5 "runoff grid" and mapping the nutrients to the blom grid using the offline mapping files for mapping rof->ocn.

The river nutrient file is here
/cluster/shared/noresm/inputdata/ocn/blom/bndcon/river_nutrients_GNEWS2000c00_r05_20250220.nc

This has to be tested with #534. @JorgSchwinger - can the data for this new riverine input also be generated on the 0.5x0.5 grid - so that I can test with the updated dataset?

@JorgSchwinger
Copy link
Contributor

This has to be tested with #534. @JorgSchwinger - can the data for this new riverine input also be generated on the 0.5x0.5 grid - so that I can test with the updated dataset?

I have copied a file for the R2OMIP river input data (same format, same grid as GNEWs but contains one additional variable) to

/cluster/shared/noresm/inputdata/ocn/blom/bndcon/river_nutrients_R2OMIPpi_r05_20250527.nc

Please let me know if there are any problems with the file.

if (chkerr(rc,__LINE__,u_FILE_u)) return
call field_getfldptr(field_blom, fldptr1=dataptr1d, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
fldlist_input = (/'DIN','DIP','DSi','DIC','Fe ','DOC','DET'/)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mvertens , why do you repeat the fldlist_input here (see l. 54)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I fixed this.


filename = '/cluster/shared/noresm/inputdata/ocn/blom/bndcon/river_nutrients_GNEWS2000c00_r05_20250220.nc'
mesh_input_file = '/cluster/shared/noresm/inputdata/share/meshes/r05_nomask_c110308_ESMFmesh.nc'
fldlist_input = (/'DIN','DIP','DSi','DIC','Fe ','DOC','DET'/)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently seems to only support the 'old' river input file - for the river2omip the slDOC seems to be missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. @JorgSchwinger just provided a new input dataset that I can use and I'll add that field.

index = 5
else if (trim(fldlist_input(nfld)) == 'DOC') then
index = 6
else if (trim(fldlist_input(nfld)) == 'DOT') then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== 'DET' ?!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now fixed as well. Thanks.

@mvertens mvertens added the enhancement New feature or request label Jun 3, 2025
Copy link
Contributor

@TomasTorsvik TomasTorsvik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvertens - Thanks, looks good to me!

@mvertens
Copy link
Contributor Author

mvertens commented Jun 3, 2025

This has to be tested with #534. @JorgSchwinger - can the data for this new riverine input also be generated on the 0.5x0.5 grid - so that I can test with the updated dataset?

I have copied a file for the R2OMIP river input data (same format, same grid as GNEWs but contains one additional variable) to

/cluster/shared/noresm/inputdata/ocn/blom/bndcon/river_nutrients_R2OMIPpi_r05_20250527.nc

Please let me know if there are any problems with the file.

@JorgSchwinger - thanks for providing this. I don't see an entry for DET in this file. Yet in mo_read_rivin.F90 the following is called - and DET is always read in.

    call ncfopn(trim(rivinfile),'r',' ',1,iotype)
    call ncread('DIN',riv_DIN2d,dummymask,0,0.)
    call ncread('DIP',riv_DIP2d,dummymask,0,0.)
    call ncread('DSi',riv_DSI2d,dummymask,0,0.)
    call ncread('DIC',riv_DIC2d,dummymask,0,0.) ! It is actually alkalinity that is observed
    call ncread('Fe' ,riv_DFe2d,dummymask,0,0.)
    call ncread('DOC',riv_idoc2d,dummymask,0,0.)
    if (use_river2omip) then
      call ncread('slDOC',riv_itdoc2d,dummymask,0,0.)
    else
      riv_itdoc2d = 0
    endif
    call ncread('DET',riv_idet2d,dummymask,0,0.)
    call ncfcls

In addition, is BLOM master - what file is used if use_river2omip is .true.? Is this currently just set in user_nl_blom?

@JorgSchwinger
Copy link
Contributor

@mvertens, yes, you are right the DET field is incorrectly named 'POC' in the file

/cluster/shared/noresm/inputdata/ocn/blom/bndcon/river_nutrients_R2OMIPpi_r05_20250527.nc

@TimotheeBrgs can you please fix this such that we have identical names for the GNEWS and the R2OMIP cases?

(For the interpolated files I fixed this in the interpolation-script, but it would be better to have this correct from the beginning).

And yes, if you use R2OMIP, you currently you need to specify the input file manually in the user namelist - something that has to be fixed once this option is tested and finalized.

@TimotheeBrgs
Copy link
Collaborator

Hi @mvertens I have now fixed the wrong naming of the DET variable. I replaced the former file with the one below. Hoping that everything else is fine.

/cluster/shared/noresm/inputdata/ocn/blom/bndcon/river_nutrients_R2OMIPpi_r05_20250604.nc

@mvertens
Copy link
Contributor Author

mvertens commented Jun 4, 2025

@TimotheeBrgs - Thanks!

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

Successfully merging this pull request may close these issues.

5 participants