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

CESM Updates #785

Merged
merged 3 commits into from
Nov 16, 2022
Merged

CESM Updates #785

merged 3 commits into from
Nov 16, 2022

Conversation

dabail10
Copy link
Contributor

@dabail10 dabail10 commented Nov 8, 2022

For detailed information about submitting Pull Requests (PRs) to the CICE-Consortium,
please refer to: https://github.com/CICE-Consortium/About-Us/wiki/Resource-Index#information-for-developers

PR checklist

  • Short (1 sentence) summary of your PR:
    Add some CESM changes to the NUOPC/CMEPS cap for async i/o and mask checking.
  • Developer(s):
    dabail10 (D. Bailey)
  • Suggest PR reviewers from list in the column to the right.
  • Please copy the PR test results link or provide a summary of testing completed below.
    CESM aux_cice suite is bfb.
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
  • Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:
    Some of the initialization in the cap is rearranged for the purposes of asynchronous i/o. Also, we have added a check for the mask comparing the grid file to the "mesh" file.

@DeniseWorthen
Copy link
Contributor

I don't see any immediate issues. I'll run some tests.

Copy link
Contributor

@apcraig apcraig left a comment

Choose a reason for hiding this comment

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

Changes in CMEPS driver layer only.

@DeniseWorthen
Copy link
Contributor

@dabail10 I'm getting failures in the CICE cap. I'll look at it more closely tomorrow

20221108 165748.983 INFO PET314 ice_export called
20221108 165748.984 ERROR PET314 ESMF_StateAPI.cppF90:2565 ESMF_StateGet Not found - no ESMF_Field found named: cpl_scalars
20221108 165748.984 ERROR PET314 /glade/work/worthen/ufs_updcice_gnu/CICE-interface/CICE/cicecore/drivers/nuopc/cmeps/ice_shr_methods.F90:287 Not found - Passing error in return code
20221108 165748.984 ERROR PET314 /glade/work/worthen/ufs_updcice_gnu/CICE-interface/CICE/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90:885 Not found - Passing error in return code

@DeniseWorthen
Copy link
Contributor

DeniseWorthen commented Nov 9, 2022

@dabail10 I see two issues. First, the call to advertise_fields is never reached for UFS---the call has been moved inside of an CESMCOUPLED ifdef block. The second issue is that I'm not sure moving the advertise_fields prior to the call to cice_init2 works. It is in cice_init2 that the ncat is set, which is needed for the advertise of the export fields which contain categories, right?

@@ -435,6 +436,7 @@ subroutine ice_import( importState, rc )
integer :: ilo, ihi, jlo, jhi !beginning and end of physical domain
type(block) :: this_block ! block information for current block
real (kind=dbl_kind),allocatable :: aflds(:,:,:,:)
real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: work
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable doesn't seem to be used. Can it be removed?

@dabail10
Copy link
Contributor Author

dabail10 commented Nov 9, 2022

Thanks for testing this! We know this works in CESM, but that is why I asked you to look at it for the UFS system. Let me look at the changes and I will hopefully have something again soon.

@DeniseWorthen
Copy link
Contributor

Just about to comment. It does look like cice_init1 will initialize the parameters I was concerned about (ncat, nfreq, nfsd) through the call to input_data. So I think the only change required will be to add the call to advertise_fields outside of the cesm ifdef block in InitializeAdvertise. I'm testing that now.

@DeniseWorthen
Copy link
Contributor

@dabail10 I've tested these two changes and everything passes for UFS.

diff --git a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
index 4d82102..41ca095 100644
--- a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
+++ b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
@@ -641,6 +641,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
     call cice_init1
     call t_stopf ('cice_init1')

+    ! Advertise fields
+    call ice_advertise_fields(gcomp, importState, exportState, flds_scalar_name, rc)
+    if (ChkErr(rc,__LINE__,u_FILE_u)) return
 #endif

     !----------------------------------------------------------------------------
diff --git a/cicecore/drivers/nuopc/cmeps/ice_import_export.F90 b/cicecore/drivers/nuopc/cmeps/ice_import_export.F90
index 1b9f340..e4db010 100644
--- a/cicecore/drivers/nuopc/cmeps/ice_import_export.F90
+++ b/cicecore/drivers/nuopc/cmeps/ice_import_export.F90
@@ -436,7 +436,6 @@ subroutine ice_import( importState, rc )
     integer                          :: ilo, ihi, jlo, jhi !beginning and end of physical domain
     type(block)                      :: this_block         ! block information for current block
     real (kind=dbl_kind),allocatable :: aflds(:,:,:,:)
-    real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: work
     real (kind=dbl_kind)             :: workx, worky
     real (kind=dbl_kind)             :: MIN_RAIN_TEMP, MAX_SNOW_TEMP
     real (kind=dbl_kind)             :: Tffresh

@dabail10
Copy link
Contributor Author

Great! I will add these changes.

@dabail10
Copy link
Contributor Author

Ok. @DeniseWorthen can you retest this to make sure I did the right thing?

@DeniseWorthen
Copy link
Contributor

Changes are good. Thanks.

@eclare108213
Copy link
Contributor

Is this PR ready to be merged?

@apcraig
Copy link
Contributor

apcraig commented Nov 14, 2022

@dabail10, just want to confirm this is ready to merge from your perspective.

@dabail10
Copy link
Contributor Author

I believe this is ready to go.

@eclare108213 eclare108213 merged commit 9808b51 into CICE-Consortium:main Nov 16, 2022
@dabail10 dabail10 deleted the cesm_updates branch December 7, 2022 16:47
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