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

Cleanup work for adding tiice to restart files for runs without fractional grid #213

Closed
climbfuji opened this issue Dec 14, 2020 · 19 comments
Assignees
Labels
enhancement New feature or request

Comments

@climbfuji
Copy link
Collaborator

Description

When #212 was merged, it was decided that always storing the ice layer temperatures separately from the soil layer temperatures is cleaner and less confusing. Until then, they were only stored separately when the fractional grid was used, but combined into the soil layer temperature array when the binary grid was used.

Solution

The cleanup work includes:

  • remove the commented lines around adding tiice to the restart data in io/FV3GFS_io.F90
  • merge the register_restart_field calls for tiice with the calls for the other arrays above in io/FV3GFS_io.F90
  • in ccpp-physics, remove the code in GFS_surface_composites.F90 that stores tiice in slt

Testing:

This change will require new baselines (because the slt array in the restart and diagnostic files will be changed)

@ShanSunNOAA
Copy link
Collaborator

Impressive bookkeeping - thanks for the info!

@junwang-noaa
Copy link
Collaborator

Some issues come up in regional LAM parallel because the tiice was added to restart sfc file in PR#212. LAM runs on non-fractional grid and does not need to have this 2 layers tiice array. Below is the description below from Eric Rogers.

In the version of chgres_cube we're running in the LAM parallels:

commit 19942e0a15ac48a9c45bf1301dff7c837158e556 (HEAD -> develop, origin/develop, origin/HEAD)
Date: Tue Dec 15 14:44:02 2020 -0500

these are the dimensions in the sfc_data file coming out of chgres_cube:

netcdf sfc_data_new {
dimensions:
xaxis_1 = 1754 ;
yaxis_1 = 1044 ;
zaxis_1 = 4 ;
Time = 1 ;

When I ran the LAMDA with the latest develop branch with has the regional inline post, I see an extra dimension added in the sfc_data file that comes out of the model:

netcdf sfc_data_new {
dimensions:
xaxis_1 = 1754 ;
yaxis_1 = 1044 ;
zaxis_1 = 2 ;
zaxis_2 = 4 ;
Time = 1 ;

This caused an abort in one of the codes Tom wrote that runs after the forecast (to address the boundary imbalance problem in the LAM DA runs), since it read the sfc_data file from the model and expected 4 dimensions. Changing this code to account for the extra dimension was trivial, and I was able to get a successful end-to-end run of the LAMDA with the inline post, but this difference may cause some confusion.

@climbfuji Please keep Eric Rogers included when the issue is resolved so that Eric can check if the tiice issue is gone in LAM.

@climbfuji
Copy link
Collaborator Author

Just to make sure we understand each other, tiice should remain in the output for both binary and fractional grid applications. If it causes a problem in one of Tom's codes, then that one will need to be fixed.

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Mar 2, 2021 via email

@climbfuji
Copy link
Collaborator Author

Putting tiice into tsfc, somewhere buried in the physics has several serious implications.

  • extremely confusing, no developer knows what is going on, where the data is stored (hidden) and retrieved from
  • this kind of logic deals with host model limitations (or external code limitations, better to say) and does not belong in physics routines
  • if kice == number of ice levels == klsm == number of lsm levels, then the array is at least filled properly
  • if kice < klsm, you need to decide what to put into the layers kice+1:klsm - missing value? zero? yet another thing to get confused about
  • if kice > klsm, the code breaks - and in fact, kice ==9 for RUC LSM, for example --> putting them back into stc will break RUC lsm and any other potential ice model with kice > klsm

@ShanSunNOAA
Copy link
Collaborator

ShanSunNOAA commented Mar 2, 2021 via email

@climbfuji
Copy link
Collaborator Author

This is all confusing ... no matter what, if kice > klsm it will break.

@climbfuji
Copy link
Collaborator Author

tiice is always written to the restart files (and read from it), no matter whether fractional or not. Simply because of the flaws of this design choice that I mentioned above. See current FV3/io/FV3GFS_io.F90.

@climbfuji
Copy link
Collaborator Author

! if (Model%frac_grid) then

@junwang-noaa
Copy link
Collaborator

So tiice is not saved in tsfc any more even for the situation of non-fractional grid with kice<klsm. Then the downstream jobs may need to know this change and update accordingly.

@climbfuji
Copy link
Collaborator Author

So tiice is not saved in tsfc any more even for the situation of non-fractional grid with kice<klsm. Then the downstream jobs may need to know this change and update accordingly.

Yep, seems to be the cleanest solution.

@SMoorthi-emc
Copy link
Contributor

SMoorthi-emc commented Mar 2, 2021 via email

@SMoorthi-emc
Copy link
Contributor

SMoorthi-emc commented Mar 2, 2021 via email

@yangfanglin
Copy link
Collaborator

yangfanglin commented Mar 2, 2021 via email

@SMoorthi-emc
Copy link
Contributor

SMoorthi-emc commented Mar 2, 2021 via email

@climbfuji
Copy link
Collaborator Author

I thought I modified to write tiice separately to avoid these issues.

Yes, that is what you did and what should remain. The cleanup work here was just a follow-up, not a reversal but got misinterpreted.

@yangfanglin this is about tiice and stc, not tsfc.

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Mar 2, 2021 via email

@SMoorthi-emc
Copy link
Contributor

SMoorthi-emc commented Mar 2, 2021 via email

SamuelTrahanNOAA pushed a commit to SamuelTrahanNOAA/fv3atm that referenced this issue Jun 13, 2022
- All `#ifdef OPENMP` are replaced with `#ifdef _OPENMP` to follow standard compiler macro for OpenMP.
- CCPP code generation is moved inside of `FV3/`.  This will be redundant when the Data Atmosphere component comes in. Updates to the python script was performed to remove the hard-wired `FV3/` path name in the file.
- `cmake/GNU.cmake` and `cmake/Intel.cmake` hard-wire global compiler definitions with `add_definitions`.  These are now applied with `target_compile_definitions`. 
- CMakeLists.txt is passed through cmake-norm checker.
- `INSTALL_INTERFACE` is added, so that this component can be installed and linked in downstream applications e.g. JEDI. 
This may be incomplete, so will need more work.
@DeniseWorthen
Copy link
Collaborator

This is a very old issue. I will close. Please re-create the issue if required.

jkbk2004 pushed a commit that referenced this issue Aug 29, 2024
…3/SAS/MYNN fix) (#865)

* Host side changes for h2o photochemistry scheme

* A fix for the issue to run C3 or SAS convection with the prognostic area fraction closure, and MYNN PBL: tendency_of_vertically_diffused_tracer_concentration from MYNN PBL

---------

Co-authored-by: Dustin Swales <dustin.swales@noaa.gov>
Co-authored-by: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
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

No branches or pull requests

6 participants