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

Add mesh cap #641

Conversation

DeniseWorthen
Copy link
Contributor

@DeniseWorthen DeniseWorthen commented Mar 20, 2022

Pull Request Summary

Enables an alternate cap for use by UWM apps S2SW and HAFSW

Description

The alternate source code utilizes the switch file switch_meshcap . A new switch option (UWM) is added to control features required by UWM.

The cap has a run-time config variable which determines whether the wave model is run in shel vs multi mode in UWM. Only a single grid has been verified when run in multi.

The new source files are:

  • wav_comp_nuopc: This is the main cap code. It advertises and realizes connected fields on a provided ESMF mesh file.
  • wav_import_export: This fills import and export state fields.
  • wav_shel_inp: Enables reading ww3_shel.inp file when run as shel.
  • wav_shr_mod: A set of utility routines to reduce code duplication.
  • w3iogoncdmd.F90: Writes gridded output fields as netcdf. Only a sub-set of all possible gridded output is currently available. When netcdf output is desired, an additional option needs to be added to the switch file (UWMNCOUT). This feature was originally coded to allow control via configuration variables but the code changes were backed out in order to resolve issues seen on the CESM side. A refactoring of the w3iogoncdmd.F90 to allow all output variables is currently under development.
  • wav_kind_mod

Code specific to CESM is added within ifdef CESMCOUPLED. Code specific to UWM is added within ifdef W3_UWM.

Please also include the following information:

  • Add any suggestions for a reviewer
  • Mention any labels that should be added: bug, documentation, enhancement, new feature
  • Are answer changes expected from this PR? Please describe the changes and the reason why in addition to which of the following labels would apply: mod_def change, out_grd change, out_pnt change, restart file change, Regression test
    -->

Issue(s) addressed

Commit Message

Adds source code to implement a mesh-based NUOPC cap in the dev/ufs-weather-model branch.

co-author: @mvertens

Check list

Testing

  • How were these changes tested?
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)?
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):
  • Please indicate the expected changes in the regression test output (Note the known list of non-identical tests).
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):

JessicaMeixner-NOAA and others added 30 commits June 24, 2021 16:21
This displays on GitHub in a nice way
 Conflicts:
	model/bin/make_makefile.sh
	model/ftn/w3gdatmd.ftn
	model/ftn/w3gridmd.ftn
	model/ftn/w3iogrmd.ftn
	model/ftn/w3srcemd.ftn
	model/ftn/w3wavemd.ftn
Squashed commit of the following:

commit 444212d
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Thu Apr 7 09:28:31 2022 -0400

    tidy up

commit 0343503
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Thu Apr 7 09:05:42 2022 -0400

    more doxygen formatting added

commit 61c10ac
Author: denise.worthen <Denise.Worthen@noaa.gov>
Date:   Wed Apr 6 22:17:19 2022 +0000

    updates more doxy

commit c9d10e4
Author: denise.worthen <Denise.Worthen@noaa.gov>
Date:   Wed Apr 6 22:02:51 2022 +0000

    fix doxy errors

    * still have warning that u_file_u is not documented ?

commit d19652f
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Wed Apr 6 17:15:34 2022 -0400

    more doxy

commit f1049d0
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Wed Apr 6 08:22:54 2022 -0400

    minor text placement changes

commit 24f9945
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Tue Apr 5 15:51:47 2022 -0400

    update 2 more files

commit fe25b63
Author: Denise Worthen <denise.worthen@noaa.gov>
Date:   Tue Apr 5 12:58:03 2022 -0400

    initial commit of added doxygen
@JessicaMeixner-NOAA
Copy link
Collaborator

@DeniseWorthen in the wmesmf cap, the inputs are either from "cpl" or you can use the original method of inputs. It looks like if we're using ww3_shel.inp that all inputs must come from the coupler? Or is there another way that is determined?

@DeniseWorthen
Copy link
Contributor Author

@JessicaMeixner-NOAA I'm not clear on your question. Are you asking if the mesh cap can be run standalone or when the forcing fields come from files?

@JessicaMeixner-NOAA
Copy link
Collaborator

@JessicaMeixner-NOAA I'm not clear on your question. Are you asking if the mesh cap can be run standalone or when the forcing fields come from files?

So let's say we wanted to coupled atm-wav, so that winds are coming from the coupler, but we'd like to have an input field of ice that comes from a file and we are using ww3_shel.inp. How would that get specified? Would that even be possible?

@mvertens
Copy link
Collaborator

@JessicaMeixner-NOAA - with CDEPS inline functionality (so that a prognostic component can ingest forcing fields like you want and easily from its cap) - this could be easily done today. I'm happy to show how this can be implemented. I can go over this briefly at our upcoming call next week.

@JessicaMeixner-NOAA
Copy link
Collaborator

@JessicaMeixner-NOAA - with CDEPS inline functionality (so that a prognostic component can ingest forcing fields like you want and easily from its cap) - this could be easily done today. I'm happy to show how this can be implemented. I can go over this briefly at our upcoming call next week.

This is a capability we have with wmesmf when using ww3_multi.inp without using a separate data model.

@mvertens
Copy link
Collaborator

@JessicaMeixner-NOAA - you are not using a separate data model - just share code functionality. I'm not suggesting this is the only way - but a powerful way to have different spatial and time interpolations (including 3d mapping) for forcing fields that it would be helpful for everyone to be aware of.

Copy link
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

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

Issues to address review comments have been made and linked in the appropriate places. In addition items that I believe will be taken care of in this PR were also noted. If these items will not be addressed in this PR please let me know so an issue for that item can be created.

@@ -1236,6 +1246,9 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT &
!
FLOUT(2) = NPT .GT. 0
!
#ifdef CESMCOUPLED
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not creating issue for this, assuming it will be taken care of in this PR.

@@ -1562,8 +1616,39 @@ SUBROUTINE W3OUTG ( A, FLPART, FLOUTG, FLOUTG2 )
USSCO=FKD*SIG(IK)*WN(IK,ISEA)*COSH(2.*KD)
BHD(JSEA) = BHD(JSEA) + &
GRAV*WN(IK,ISEA) * EBD(IK,JSEA) / (SINH(2.*KD))
#ifdef CESMCOUPLED
Copy link
Collaborator

Choose a reason for hiding this comment

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

The proposed subsequent updates are covered in these issues:

@@ -0,0 +1,759 @@
#include "w3macros.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

An issue was created for this: #673 where we can continue this discussion

@@ -430,18 +438,32 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
!
! open file ---------------------------------------------------------- *
!
#ifdef CESMCOUPLED
Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue to address this is here: #674

@@ -1803,6 +1807,9 @@ SUBROUTINE W3UICE ( VA )
ICEI(IX,IY), 'ICE (NEW)'
#endif
VA(:,JSEA) = 0.
#if defined(W3_UWM) || defined(CESMCOUPLED)
charn(jsea) = aalpha
Copy link
Collaborator

Choose a reason for hiding this comment

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

The follow up for this issue is here: #677

@@ -1540,11 +1545,9 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
!
! 3.3.3 Update ice floe diameter
!
#ifdef W3_IS2
#if defined(W3_IS2) || defined(CESMCOUPLED)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assuming this will be updated in this PR and so no issues is made.


end subroutine set_shel_io

subroutine set_shel_inp(dtime_sync)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Follow up issue: #678

end subroutine set_shel_inp

!===============================================================================
subroutine read_shel_inp(mpi_comm)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue for this is here: #679

* change cesmcoupled to w3_cesmcoupled
* removed commented out line in w3init
* mark sections which require fixes and testing
for cesm
* remove marked sections for pr review
Copy link
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

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

All issues that were going to be taken care of before the PR was merged have been addressed.

@JessicaMeixner-NOAA JessicaMeixner-NOAA self-requested a review May 4, 2022 16:49
alperaltuntas added a commit to ESCOMP/WW3 that referenced this pull request May 5, 2022
Copy link
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

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

The regression tests are as expected:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR2_UNO_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (16 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (14 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (15 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (12 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (16 files differ)
ww3_ta1/./work_UPD0F_U                     (0 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (7 files differ)
ww3_tp2.16/./work_MPI_OMPH                     (4 files differ)
ww3_tp2.17/./work_ma                     (1 files differ)
ww3_tp2.17/./work_a                     (1 files differ)
ww3_tp2.17/./work_mb                     (1 files differ)
ww3_tp2.17/./work_mc                     (1 files differ)
ww3_tp2.17/./work_c                     (1 files differ)
ww3_tp2.17/./work_b                     (1 files differ)
ww3_tp2.6/./work_ST0                     (1 files differ)
ww3_tp2.6/./work_ST4                     (1 files differ)
ww3_tp2.6/./work_pdlib                     (1 files differ)
ww3_ufs1.3/./work_a                     (1 files differ)

There are the known b4b cases + the unstructured mod_def files which have at times been not b4b lately.

@JessicaMeixner-NOAA JessicaMeixner-NOAA merged commit ec5077a into NOAA-EMC:dev/ufs-weather-model May 31, 2022
@DeniseWorthen DeniseWorthen deleted the feature/cmake_meshcapbuild branch November 3, 2022 15:07
@DeniseWorthen DeniseWorthen restored the feature/cmake_meshcapbuild branch November 3, 2022 15:08
@DeniseWorthen DeniseWorthen deleted the feature/cmake_meshcapbuild branch November 3, 2022 15:08
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

Successfully merging this pull request may close these issues.

9 participants