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

New gtg code compiling option needed #429

Closed
WenMeng-NOAA opened this issue Jan 7, 2022 · 12 comments · Fixed by #430
Closed

New gtg code compiling option needed #429

WenMeng-NOAA opened this issue Jan 7, 2022 · 12 comments · Fixed by #430
Labels
enhancement New feature or request

Comments

@WenMeng-NOAA
Copy link
Collaborator

The gtg code is stored at a NCAR private github repository. Only granted users can check out gtg code as a submodule of UPP at sorc/ post_gtg.fd. UPP needs an option for compiling gtg code from sorc/post_gtg.fd instead of overwriting the stub gtg code at sorc/ncep_post.fd via cmake.

@WenMeng-NOAA WenMeng-NOAA added the enhancement New feature or request label Jan 7, 2022
@WenMeng-NOAA
Copy link
Collaborator Author

@junwang-noaa @DusanJovic-NOAA @climbfuji @aerorahul UPP needs help on this new build feature. Would you please let me know your suggestions. Thanks!

@kgerheiser
Copy link
Contributor

kgerheiser commented Jan 7, 2022

Sounds like you want ExternalProject_Add to pass build commands to gtg. How does gtg build (CMake, Makefile, etc)?

@WenMeng-NOAA
Copy link
Collaborator Author

@kgerheiser gtg code along with other UPP code are compiled via CMake. We currently overwrite the stub gtg code (with suffix .F90, e.g. gtg_algo.F90 ) under sorc/ncep_post.fd with real gtg code from sorc/post_gtg.fd.

@aerorahul
Copy link
Contributor

@WenMeng-NOAA
You would build the GTG code in sorc/post_gtg.fd with CMake into a library.
You would build the GTG stub code in sorc/ncep_post.fd with CMake into a library.

When one or the other is available, use the appropriate one to create the UPP library.

@DusanJovic-NOAA
Copy link
Contributor

Another alternative. Since g2g is optional functionality, introduce a build option that enables g2g (optionally ON, OFF by default), then in sorc/ncep_post.fd/CMakeLists.txt use that option to add actual g2g modules to the library, and in the source code where g2g code is used add something like #ifdef G2G_ENABLED to conditionally use g2g module and call 2g2 subroutines. This will eliminate the need for stub code.

@WenMeng-NOAA
Copy link
Collaborator Author

@aerorahul @kgerheiser @DusanJovic-NOAA The gtg code building might have dependency on other general UPP routines. I invite @YaliMao-NOAA in the discussion. She could provide details. We don't have more CMake knowledge. Could we get further guidance? I have an UPP checkout including gtg at /u/Wen.Meng/noscrubd6/ncep_post/develop/UPP/ on Venus. You might use it for testing. Thanks!

@YaliMao-NOAA
Copy link
Contributor

@WenMeng-NOAA You are right, GTG calls some subroutines of the general UPP. It's part of UPP code, not a standalone package.

@aerorahul
Copy link
Contributor

This branch is basically it.
I tried to build the UPP library on wcoss2 with the current develop, but ran into errors in the GTG code.

/lfs/h2/emc/stmp/Rahul.Mahajan/uppWork/upp/sorc/post_gtg.fd/gtg_compute.F90:2351: undefined reference to `defuvp_'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /lfs/h2/emc/stmp/Rahul.Mahajan/uppWork/upp/sorc/post_gtg.fd/gtg_compute.F90:2

@kgerheiser
Copy link
Contributor

Looks good @aerorahul.

I would also incorporate optionally find/linking to ip based on that option. See #370

@aerorahul
Copy link
Contributor

Looks good @aerorahul.

I would also incorporate optionally find/linking to ip based on that option. See #370

@kgerheiser done in 85138f0

@YaliMao-NOAA
Copy link
Contributor

This branch is basically it. I tried to build the UPP library on wcoss2 with the current develop, but ran into errors in the GTG code.

/lfs/h2/emc/stmp/Rahul.Mahajan/uppWork/upp/sorc/post_gtg.fd/gtg_compute.F90:2351: undefined reference to `defuvp_'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /lfs/h2/emc/stmp/Rahul.Mahajan/uppWork/upp/sorc/post_gtg.fd/gtg_compute.F90:2

defuvp is defined in map_routines.F90, which is part of GTG code.

@WenMeng-NOAA
Copy link
Collaborator Author

Thanks for all your help! I tested PR #430 on Dell. The executable was successfully built.

EricJames-NOAA pushed a commit to EricJames-NOAA/UPP that referenced this issue Dec 14, 2022
…ministic analysis and adding tasks for additional ensemble free forecast (NOAA-EMC#429)
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 a pull request may close this issue.

5 participants