Skip to content

Use CPP instead of Switches#476

Merged
aliabdolali merged 154 commits into
NOAA-EMC:developfrom
JessicaMeixner-NOAA:feature/switch2cpp_build_src
Oct 19, 2021
Merged

Use CPP instead of Switches#476
aliabdolali merged 154 commits into
NOAA-EMC:developfrom
JessicaMeixner-NOAA:feature/switch2cpp_build_src

Conversation

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA commented Sep 15, 2021

Pull Request Summary

Use CPP ifdefs instead of switches for pre-processing and convert all code from ftn to F90 files. (ftn->src)

Description

This PR provides a utility in tools/ that converts the WW3 switches into CPP ifdefs. The build is also updated for this change. The utility in model/tools/ftn2src.sh is run to convert the ftn to a src directory.

Co-author: @ukmo-ccbunney

Issue(s) addressed

Check list

Commit Message

  • Use CPP ifdefs instead of switches for pre-processing and convert all code from ftn to F90 files. (ftn->src) The tools for converting ftn->src can be found in the model/tools directory.

Testing

  • How were these changes tested? matrix_ncep regression tests
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) yes
  • If a new feature was added, was a new regression test added? existing tests are sufficient
  • Have regression tests been run? yes
  • Which compiler / HPC you used to run the regression tests in the PR? hera.intel
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt): (Note these are compared to output from PR454 as its included in this PR)

matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt

Please indicate the expected changes in the outputs (excluding the known list of non-identical tests).

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR3_UQ_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (9 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR1_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e_c                     (1 files differ)
mww3_test_07/./work_PR3_UQ                     (3 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (6 files differ)
ww3_ufs1.1/./work_b                     (0 files differ)
ww3_ufs1.2/./work_b                     (0 files differ)
ww3_ufs1.3/./work_a                     (1 files differ)
  • Please list which labels code managers should add to indicate code changes:
    There should be no output changes

JessicaMeixner-NOAA and others added 30 commits May 17, 2021 23:55
although remove build suppert for NETCDFv3
if (NCTYPE=4) statements on NC4 lines instead
…eature/removeNC4switch

 Conflicts:
	manual/impl/switch.tex
	model/bin/make_makefile.sh
JessicaMeixner-NOAA and others added 6 commits October 6, 2021 14:54
…ure/switch2cpp_build_nosrc

Conflicts:
	model/tools/ftn2src.sh
…o feature/switch2cpp_build_src

Conflicts:
	model/src/gx_outp.F90
	model/src/w3gridmd.F90
	model/src/w3iogrmd.F90
	model/src/w3iopomd.F90
	model/src/w3odatmd.F90
	model/src/w3src4md.F90
	model/src/w3srcemd.F90
	model/src/w3wavemd.F90
	model/src/ww3_ounf.F90
	model/src/ww3_ounp.F90
	model/src/ww3_outp.F90
@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator Author

Okay, the latest develop has been merged in. This branch is ready for further testing.

@aliabdolali since the ufs-weather-model results have changed, I cannot make a PR without changing results for this PR until your PR is complete. I will make a subsequent ufs-weahter-model PR with this branch, but as I think this is a fairly large change it should be done separately. I will make a ufs-weather-model issue for this.

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator Author

All of the code here is up to date and is ready for everyone to do a full set of regression tests. I'll start a new set here at EMC as well.

@ukmo-ccbunney @thesser1 (or Mary) @mickaelaccensi can you please all test again? @aliabdolali this is ready for your review as well. I'll post new matrix.comp & ufs-weather-model regtest updates asap.

@ukmo-ccbunney
Copy link
Copy Markdown
Collaborator

Full regression test matrix completed ok with only the usual suspects being non-B4B:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR3_UQ_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (9 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (7 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (9 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_e                     (1 files differ)

@aliabdolali
Copy link
Copy Markdown
Contributor

Full regression test matrix completed ok with only the usual suspects being non-B4B:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR3_UQ_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (9 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (7 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (9 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_e                     (1 files differ)

Thanks @ukmo-ccbunney
I put a hold on new PRs before we test and merge this PR.

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator Author

The regression tests on hera are still in the queue. I'm working on getting the matrix.comp output for hera. The ufs-weather-model tests have run on some but not all platforms I have access too. Will post results when I have them. Thanks @ukmo-ccbunney for running the tests at your end. Do you approve of this PR now? (It still says you request changes).

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator Author

Issue #494 is stopping me from completing these tests. We will likely need some sort of bug-fix in develop before we can proceed with testing this.

@thesser1
Copy link
Copy Markdown
Collaborator

thesser1 commented Oct 14, 2021

Regression results from my intel compiler


********************* non-identical cases ****************************


mww3_test_03/./work_PR2_UQ_MPI_d2 (8 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2 (10 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c (6 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2 (9 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2 (6 files differ)
mww3_test_03/./work_PR1_MPI_d2 (9 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c (8 files differ)
mww3_test_07/./work_PR3_UQ (3 files differ)
ww3_ufs1.1/./work_d (1 files differ)
ww3_ufs1.1/./work_c (1 files differ)
ww3_ufs1.1/./work_c_npl (1 files differ
matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt
)

@aliabdolali
Copy link
Copy Markdown
Contributor

Regression results from my intel compiler

********************* non-identical cases ****************************

mww3_test_03/./work_PR2_UQ_MPI_d2 (8 files differ) mww3_test_03/./work_PR2_UNO_MPI_d2 (10 files differ) mww3_test_03/./work_PR3_UNO_MPI_d2_c (6 files differ) mww3_test_03/./work_PR3_UQ_MPI_d2 (9 files differ) mww3_test_03/./work_PR3_UNO_MPI_d2 (6 files differ) mww3_test_03/./work_PR1_MPI_d2 (9 files differ) mww3_test_03/./work_PR3_UQ_MPI_d2_c (8 files differ) mww3_test_07/./work_PR3_UQ (3 files differ) ww3_ufs1.1/./work_d (1 files differ) ww3_ufs1.1/./work_c (1 files differ) ww3_ufs1.1/./work_c_npl (1 files differ)

Thanks @thesser1
I assume all tests passed on your hpc, right?
Could you upload the matrix.comp stdout files?

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator Author

I'll post comparisons in the next hour --- so far all tests are looking good for me. Then we just need @mickaelaccensi to confirm things are working

@mickaelaccensi
Copy link
Copy Markdown
Collaborator

it's running. I'll tell you the results once it's done

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator Author

Regtests passed on hera, except for known issues:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR2_UQ_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (13 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (8 files differ)
mww3_test_07/./work_PR3_UQ                     (3 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (7 files differ)
ww3_tp2.16/./work_MPI_OMPH                     (5 files differ)
ww3_ufs1.1/./work_d                     (0 files differ)
ww3_ufs1.2/./work_b                     (0 files differ)
ww3_ufs1.3/./work_a                     (1 files differ)

Regression tests also ran on orion, with known issues of netcdf errors

matrixDiff.txt
matrixCompSummary.txt
matrixCompFull.txt

ufs-weather-model passed for gaea.intel, hera.intel and Orion.intel for wave tests except for known point output not matching. The branch with tests is here: https://github.com/JessicaMeixner-NOAA/ufs-weather-model/tree/feature/ww3cpp

@mickaelaccensi
Copy link
Copy Markdown
Collaborator

all regtests passed except usual mww3_test_03
matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt

@aliabdolali aliabdolali merged commit dd31794 into NOAA-EMC:develop Oct 19, 2021
aliabdolali pushed a commit that referenced this pull request Oct 21, 2021
Updates dev/ufs-weather-model to the latest develop branch. This includes the switch->CPP transition.
aliabdolali pushed a commit that referenced this pull request Nov 3, 2021
Use CPP ifdefs instead of switches for pre-processing and convert all code from ftn to F90 files. (ftn->src) 
The tools for converting ftn->src can be found in the model/tools directory.
@JessicaMeixner-NOAA JessicaMeixner-NOAA deleted the feature/switch2cpp_build_src branch November 13, 2021 12:35
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.

Transition from switch pre-processing to CPP ifdefs

5 participants