Skip to content

update ERF interface for snow and wetland noahmp physics update#190

Merged
cenlinhe merged 3 commits intoNCAR:developfrom
cenlinhe:erf_sync
May 19, 2025
Merged

update ERF interface for snow and wetland noahmp physics update#190
cenlinhe merged 3 commits intoNCAR:developfrom
cenlinhe:erf_sync

Conversation

@cenlinhe
Copy link
Collaborator

@cenlinhe cenlinhe commented May 7, 2025

This PR is to update the ERF/NoahMP driver interface to accommodate the recent NoahMP source code physics updates for snowpack and wetland processes.
The NoahMP source code updates can be found from these PRs:
#187
#186
#175
#174

@cenlinhe
Copy link
Collaborator Author

cenlinhe commented May 7, 2025

@akashdhruv Could you please do a ERF/NoahMP test for this updated version to ensure the updated driver interface works successfully?

@akashdhruv
Copy link
Contributor

@cenlinhe Yes will do.

@cenlinhe
Copy link
Collaborator Author

akashdhruv

Hi @akashdhruv If you could test this at your earliest convenience, that would be great. We need to merge this PR asap to prepare for the Noah-MP release. Thanks!

@akashdhruv
Copy link
Contributor

@cenlinhe I will finish this by Tuesday.

@akashdhruv
Copy link
Contributor

@cenlinhe I was able to review today and here are my findings.

  • Compilation error in src/SnowRadiationSnicarMod.F90 line 568. Changing to if (FlagSnicarUseAerosol .eqv. .true.) then fixed it.

  • Compilation error in src/SnowRadiationSnicarMod.F90 line 571. Changing to if (FlagSnicarUseOC .eqv. .true.) then fixed it.

  • Compilation error in src/SnowRadiationSnicarMod.F90 line 1522. Changing to write (*,"(a,e13.6,i0,i0,i0,i0)") "SNICAR ERROR: negative absoption : ", & fixed it.

  • Segfault in src/SurfaceAlbedoGlacierMod.F90 line 59 and 68. Commenting them out fixed it.

  • Segfault in src/SurfaceAlbedoMod.F90 line 109 and 110. Commenting them out fixed it.

@cenlinhe
Copy link
Collaborator Author

cenlinhe commented May 18, 2025

@akashdhruv Thank you for testing.

  1. I assume that the compilation error is because you need to add the two new flag variables on your ERF model code side, right?
  2. What are the segfault messages? Is it related to ERF specific setup or missing variables? These two new variables are related to our newly included snow physics in source code (src/SurfaceAlbedoGlacierMod.F90 and src/SurfaceAlbedoMod.F90), could you please find a fix without commenting them out? We hope the source code (src/) will be the same for all parent models using Noah-MP. In our offline Noah-MP test, these two places do not have issues and the model runs well.

@akashdhruv
Copy link
Contributor

akashdhruv commented May 18, 2025

  1. I assume that the compilation error is because you need to add the two new flag variables on your ERF model code side, right?

I don't think that is the case.

  1. What are the segfault messages? Is it related to ERF specific setup?

The segfault creates a Backtrace which I was able to trace it back to these lines. I suspect that I am not supplying certain variables in my namelist file. Right now I set NSNOW=4 in my namelist file. Could that be causing an issue?

@akashdhruv
Copy link
Contributor

akashdhruv commented May 18, 2025

If you can fix the compilation errors based on the suggestions that worked for me, then I think this is ok. I can review the segfaults carefully and fix them on erf side.

@cenlinhe
Copy link
Collaborator Author

Regarding the compilation, please ignore my message. I figured it out.
Regarding the segfault messages, yes, the NSNOW=4 might be the issue. In our Noah-MP model, currently we can only handle NSNOW = 3.

@cenlinhe
Copy link
Collaborator Author

If you can fix the compilation errors based on the suggestions that worked for me, then I think this is ok. I can review the segfaults carefully and fix them on erf side.

Yes, I will fix the compilation errors based on your suggestions. Thanks!

@akashdhruv
Copy link
Contributor

akashdhruv commented May 18, 2025

I fixed the segfaults by changing:

SNOW_ALBEDO_OPTION = 2 --> SNOW_ALBEDO_OPTION = 3 in my ERF namelist file.

@cenlinhe
Copy link
Collaborator Author

@RAbolafiaRosenzweig @tslin2 I have fixed all the bugs reported by @akashdhruv above in the latest commit. Please review and approve this PR at your earliest convenience.
@akashdhruv I have fixed the bug that causes the segfault error. Now you should still be able to use SNOW_ALBEDO_OPTION = 2 in your erf namelist. The reason for the error is that those two new variables are only defined when SNOW_ALBEDO_OPTION = 3. Now I moved their initialization to within the SNOW_ALBEDO_OPTION = 3 if-statement.

@cenlinhe cenlinhe merged commit c402c85 into NCAR:develop May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants