ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

Create unit test from orog_mask_tools.fd/lake.fd/enclosure_cnvx.F90 #377

Open kgerheiser opened 3 years ago

kgerheiser commented 3 years ago

There is a small test in there that should be converted to a unit test in CMake.

kgerheiser commented 3 years ago

How do you link in the source code if we want to create tests? Everything is built as an executable with no intermediate library where we can test the code.

What if the executables were built with an intermediate (static) library? All the source files except the main program could be compiled into a library so that code can be tested, and the executable would be program linked to the library.

edwardhartnett commented 3 years ago

I believe that is the answer we are looking for.

An easier alternative for me has been to just include the fortran files that I need to compile my test program.

I was not thinking we would do this for orog_mask_tools yet, chgres_cube is the immediate target, since that's where most of the code changes are.

That said, if you want to quickly try this and get it in place, I have no objection...