NOAA-EMC / fv3atm

Other
28 stars 151 forks source link

Guidance on Merging Updates from UFS-Chem I/O into Current UFS/FV3 I/O Files #768

Open zhanglikate opened 5 months ago

zhanglikate commented 5 months ago

Description

UFS-Chem: an innovative community model of chemistry online coupled with UFS, which is a wide collaboration between NOAA Oceanic and Atmospheric Research (OAR) laboratories and NCAR. It utilizes the Common Community Physics Package (CCPP) infrastructure to link the gas and aerosol chemistry modules to the rest of the model that enhance the research capabilities to use different gas and aerosol chemical mechanisms to couple different physics options. One of the aerosol components based on the current operational GEFS-Aerosols, has been implemented into UFS-Chem with some updates to wet deposition, dust and fire emission etc. The current version of UFS-Chem is based on the UFS Prototype 8 (P8) code from 2022 August. The development team is seeking to merge and update UFS-Chem to the latest version of UFS code, incorporating all the relevant updates from UFS-Chem into UFS code.

Last year, the UFS I/O file underwent reconstruction, resulting in several distinct I/O files, which is quite different to structure in the P8 code. The UFS-Chem development team is now seeking assistance and guidance from the UFS/FV3 I/O development team, to facilitate the merging of updates from UFS-Chem I/O into the current UFS/FV3 I/O files. For a detailed overview of the differences/updates in the FV3 I/O file between UFS-Chem and the UFS P8 code, please refer to the link: https://github.com/zhanglikate/fv3atm/pull/1/files#diff-47a8371f604cc35340090168c6379e8f25cba47528b9e40c6c252f0ccfdc4925

To facilitate the collaboration, we would appreciate guidance on the best approach to merging these updates, considering the differences in the I/O file structures. Additionally, any insights into potential challenges or recommended strategies would be invaluable.

Looking forward to your guidance and collaboration on this matter.

DusanJovic-NOAA commented 5 months ago

I tried to merge the develop branch into zhanglikate/fv3atm:gsl-updates and unsurprisingly there are a huge number of conflicts. I see the last common commit in these two branches is commit 0f9aa06 from Aug 3 2022. Since then there were more than 100 commits to the develop branch.

You can try to merge with develop and try to resolve as many commit conflicts, but in some cases I think it might be simply easier to just grab the develop branch version of a file and manually port the changes from gsl-updates.

In the future I suggest you merge with upstream (develop) more often, do not wait almost a year and a half.

zhanglikate commented 5 months ago

@DusanJovic-NOAA @junwang-noaa Dusan, thank you very much for your suggestions. Initially, our research project focused solely on the P8 UFS code, but we plan to expand our scope in the future. Currently, we are facing challenges related to the reconstruction of the I/O file. For instance, we observed that the RRFS-smoke and dust input has been separated, as indicated in fv3atm_rrfs_sd_io.F90. While this file pertains to a regional model input, we are seeking guidance on the best approach to implement the I/O part for our UFS-Chem global input. Specifically, we are looking for a sample I/O file that we can use as a reference to achieve a similar layout in our code. Any insights you can provide on this matter would be greatly appreciated. Thank you.

DusanJovic-NOAA commented 5 months ago

I'm not sure what you mean by 'sample I/O file'. Do you mean sample input file, or sample output/history file. You should have such files in your current version based on the P8 version. When you run current code does it create separate files for chem fields or does it write them in physics history file (sfcf000.nc file).

zhanglikate commented 5 months ago

@DusanJovic-NOAA If you check the differences/updates in the FV3 I/O file between UFS-Chem and the UFS P8 code, please refer to the link: https://github.com/zhanglikate/fv3atm/pull/1/files#diff-47a8371f604cc35340090168c6379e8f25cba47528b9e40c6c252f0ccfdc4925, you will see the I/O code that we added for UFS-Chem. I meant in the current FV3/io folder, which io.F90 file that we can use to merge our UFS-Chem I/O code into it? Or we need to create a new io.F90 file for UFS-Chem I/O seperately? If we need to create a new one similar to fv3atm_oro_io.F90. While the fv3atm_oro_io.F90 is for regional input, then which io.F90 file that we can use as reference to create a io.F90 file, the fv3atm_rrfs_sd_io.F90. or the fv3atm_oro_io.F90? Thanks.

DusanJovic-NOAA commented 5 months ago

Please check with Sam (@SamuelTrahanNOAA ), but I think that you should be able to add your changes to fv3atm_rrfs_sd_io.F90, because I see it writes out dust and emission related variables, similar to what you have in your code.

SamuelTrahanNOAA commented 5 months ago

It makes sense to put ufs-chem and rrfs-sd I/O in the same file. The rrfs-sd and ufs-chem are the offspring of the same parent. They use some of the same internal variables and both need emissions. Some of the I/O code will overlap, too.

If you need to broaden the scope of the file, you could rename it. Perhaps rename "fv3atm_rrfs_sd_io.F90" to "fv3atm_chem_io.F90."

zhanglikate commented 5 months ago

@SamuelTrahanNOAA @DusanJovic-NOAA , Thank you very much for all your valuable suggestions.