NOAA-EMC / GLDAS

0 stars 4 forks source link

Build with cmake #22

Open aerorahul opened 2 years ago

aerorahul commented 2 years ago

Migrate the build system to cmake to facilitate porting to new machines.

aerorahul commented 2 years ago

Is there someone I can work with on the GLDAS team who could verify the output from executables with cmake reproduce current build?

Much appreciated.

barlage commented 2 years ago

@aerorahul do you need sample inputs as well? I assume this is a full system test and not any testing of sub-components.

@jiaruidong2017 are you able to participate in this? or @HelinWei-NOAA do you have any other suggestions?

jiaruidong2017 commented 2 years ago

I am able to participate in this task, and please let me know how I can assist. Thanks.

aerorahul commented 2 years ago

@jiaruidong2017 I can provide you with a branch that builds the executables in this repository with CMake. If you can run test cases and validate whether these CMake built executables reproduce current master, that would be appreciated. If there are differences, I can troubleshoot iteratively with you and identify the source of the discrepancies.

I will have a branch for you with instructions to build with CMake sometime next week.

Thank you for your assistance.

jiaruidong2017 commented 2 years ago

@aerorahul Sure, and please let me know when it is ready.

aerorahul commented 2 years ago

@jiaruidong2017

I have a branch feature/cmake ready for testing most of the source code built under sorc/ except sorc/gldas_model.fd. The build for the executable gldas_model is complicated. It does not need to be so. There are duplicate files in sorc/gldas_model.fd/make e.g. absoft.h, mpif.h, ftn_drv.h that also exist in sorc/gldas_model.fd/core. There are also unique files in sorc/gldas_model.fd/make e.g. misc.h, ftn.h. misc.h is included in a lot of files throughout the code.

I have a few questions before I go down the path of converting this (gldas_model.fd) to cmake.

HelinWei-NOAA commented 2 years ago
  • is this gldas_model executable used in our applications? I could not find its use or reference in any of the scripts, ush or jobs directories. Yes. It is used in scripts/exgdasgldas.sh.ecf as shown below ln -fs $EXECgldas/gldas${model} $RUNDIR/LIS

  • do we have someone who understands this source code and its build? Or is it just a dump from the NASA-LIS/LISF repository? It is built by @YoulongXia-NOAA. He should know the source code and its build.

aerorahul commented 2 years ago
  • is this gldas_model executable used in our applications? I could not find its use or reference in any of the scripts, ush or jobs directories. Yes. It is used in scripts/exgdasgldas.sh.ecf as shown below ln -fs $EXECgldas/gldas${model} $RUNDIR/LIS

  • do we have someone who understands this source code and its build? Or is it just a dump from the NASA-LIS/LISF repository? It is built by @YoulongXia-NOAA. He should know the source code and its build.

Thanks @HelinWei-NOAA I will direct further questions on the build of gldas_model to @YoulongXia-NOAA

jiaruidong2017 commented 2 years ago

Thanks @HelinWei-NOAA for the response.

NO, they are totally different. This LIS based GLDAS was maintained at EMC by modifying the old version of NASA LIS.

jiaruidong2017 commented 2 years ago

@aerorahul The gldas_model.fd should come from our EMC maintained repository at https://github.com/NOAA-EMC/GLDAS, which were totally different from the NASA-LIS/LISF/lis. Our EMC GLDAS modified the very old version of NASA LIS. 

When you build the gldas_model.fd module, it will generate the gldas_model.fd/make/ directory and all the dependent code (.o and .d files) will be copied to the /make directory. Before compiling the code, the configure will be executed to move some .h files into the ./make directory. In our EMC version, we don't execute the configure file, instead we copied them directly into the ./make directory. Therefore, you see the duplication codes. 

YoulongXia-NOAA commented 2 years ago

Yes, @jiaruidong2017 is correct. This comes directly from Jesse Meng's CFS/GLDAS framework. If you like to know more, please contact to @JesseMeng-NOAA. I think that he used old LIS framework and made some modifications. I should have any direct relationship with NEW LIS framework if I understand correctly.

YoulongXia-NOAA commented 2 years ago

It should have any direct relationship with NEW LIS framework if I understand correctly. @JesseMeng-NOAA, if I am wrong, please correct me and give more explanations.