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

Fix dumpfields=true option by using ESMF_FieldBundleWrite #856

Merged
merged 31 commits into from
Jul 29, 2024

Conversation

DusanJovic-NOAA
Copy link
Collaborator

Description

This PR fixes dumpfields=true option which can be used to write all coupling fields (from import and export states) by using updated version of ESMF's ESMF_FieldBundleWrite function instead of old ESMFIO_Write.

Fixes ufs-community/ufs-weather-model#1765

Is a change of answers expected from this PR? No.

Issue(s) addressed

Link the issues to be closed with this PR, whether in this repository, or in another repository.
(Remember, issues should always be created before starting work on a PR branch!)

Testing

How were these changes tested?
What compilers / HPCs was it tested with?
Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)
Have the ufs-weather-model regression test been run? On what platform?

  • Will the code updates change regression test baseline? If yes, why? Please show the baseline directory below.
  • Please commit the regression test log files in your ufs-weather-model branch

Dependencies

N/A

@DusanJovic-NOAA
Copy link
Collaborator Author

When I run one of the coupled regression tests (cpld_control_p8_intel) with DumpFields = true I see this error in PET000 file:

20240703 150754.552 ERROR            PET000 ESMCI_IO.C:1614 ESMCI::IO::checkNtiles() Wrong data value  - New number of tiles (6) does not match previously-set number of tiles (1) for this IO object. All arrays handled by a given IO object must have the same number of tiles.
20240703 150754.554 ERROR            PET000 ESMCI_IO.C:1566 ESMCI::IO::setOrCheckNtiles() Wrong data value  - Internal subroutine call returned Error
20240703 150754.554 ERROR            PET000 ESMCI_IO.C:1064 ESMCI::IO::addArray() Wrong data value  - Internal subroutine call returned Error
20240703 150754.554 ERROR            PET000 /scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/cache/build_stage/spack-stage-esmf-8.6.0-nnuwc5zlpvogeiuk3nec26eryjiwsopw/spack-src/src/Infrastructure/Field/interface/ESMCI_Field_F.C:144 c_esmc_fieldioaddarray() Wrong data value  - Internal subroutine call returned Error
20240703 150754.554 ERROR            PET000 ESMF_FieldBundle.F90:17926 ESMF_FieldBundleWrite() Wrong data value  - Internal subroutine call returned Error
20240703 150754.554 ERROR            PET000 module_cap_cpl.F90:233 Wrong data value  - Passing error in return code
20240703 150754.554 ERROR            PET000 module_cap_cpl.F90:73 Wrong data value  - Passing error in return code

but model continues to execute.

I see only fv3_cap_import_2021-03-22T06:00:00.tile?.nc being created, but no fv3_cap_export_.... Probably due to an above error.

@DusanJovic-NOAA DusanJovic-NOAA marked this pull request as ready for review July 8, 2024 13:04
@DusanJovic-NOAA DusanJovic-NOAA mentioned this pull request Jul 9, 2024
@junwang-noaa
Copy link
Collaborator

@DusanJovic-NOAA would you like to include the one line change in PR#857? That PR should have no impact on RT. Thanks

@DusanJovic-NOAA
Copy link
Collaborator Author

@DusanJovic-NOAA would you like to include the one line change in PR#857? That PR should have no impact on RT. Thanks

Sure, I can merge changes from #857.

@DeniseWorthen
Copy link
Collaborator

@DusanJovic-NOAA I'd like to add the fix the scalar_id=0 issue (#838). It also adds a check to enforce the setting of the NTile scalar index. I made a draft PR to your FV3 branch here.

@DusanJovic-NOAA
Copy link
Collaborator Author

@DusanJovic-NOAA I'd like to add the fix the scalar_id=0 issue (#838). It also adds a check to enforce the setting of the NTile scalar index. I made a draft PR to your FV3 branch here.

I just synced my branch with develop, can you sync your branch. Thanks.

@DeniseWorthen
Copy link
Collaborator

I should be up to date w/ develop.

* fix issues w/ cplscalars
* error out of all 3 spatial indices are not present
* add check for scalar_id = 0
@DeniseWorthen
Copy link
Collaborator

@DusanJovic-NOAA I've tested the dumpfields and it is working, but I've made a PR to your branch for a couple of changes. First, to add a timeslice, so that files can be ncrcat'td into a timeseries. Also, in the other components, we generally retrieve the OverwriteSlice config variable, which is always .true.. Since FV3 doesn't retrieve this right now, I just manually set the value as true.

The second change is to write the filenames w/ either an import time or export time string. This makes comparing w/ the mediator history files easier. I've checked that using the FV3 dump fields capability does match the mediator history files (matching cmeps 'import from atm' == fv3 'export from cap').

* use import and export time strings
* add timeslice
@DeniseWorthen
Copy link
Collaborator

Thanks for fixing this @DusanJovic-NOAA. It has been not working for over a year!

@FernandoAndrade-NOAA
Copy link

Testing on #2355 has completed, please continue with the merge process here. Thank you.

@jkbk2004 jkbk2004 merged commit 0495c19 into NOAA-EMC:develop Jul 29, 2024
6 checks passed
@DusanJovic-NOAA DusanJovic-NOAA deleted the dump_cpl_fields branch July 30, 2024 13:21
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.

dumpfields=true fails in module_fcst_grid_comp.F90 for coupled model
7 participants