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

cft_update.x needs to be compiled with big-endian read of diag file #82

Open
gmao-msienkie opened this issue Apr 12, 2021 · 5 comments
Open
Labels
bug Something isn't working

Comments

@gmao-msienkie
Copy link
Contributor

in Applications/GMAO_Etc/GMAO_bias the program cft_update.x needs to be compiled with big_endian to be able to read conventional diag files.

@gmao-msienkie gmao-msienkie added the bug Something isn't working label Apr 12, 2021
@gmao-msienkie
Copy link
Contributor Author

The program runs if the environment variable FORT_CONVERT10 is set to 'big_endian' but not otherwise.

The GNUmakefile in CVS had "USER_FFLAGS = $(BIG_ENDIAN) $(DGEOS5)"

@mathomp4
Copy link
Member

Oops. I guess I missed this. Well, first, it looks like DGEOS5 is unneeded as, well, nothing in that directory has #ifdef GEOS5. But the big-endian needs to be fixed.

If you'd like to test, the solution should be to add:

set_target_properties (convert_cft.x PROPERTIES COMPILE_FLAGS "${BIG_ENDIAN}")
set_target_properties (cft_update.x PROPERTIES COMPILE_FLAGS "${BIG_ENDIAN}")

to the CMakeLists.txt in Applications/GMAO_Etc/GMAO_bias

@gmao-msienkie
Copy link
Contributor Author

Thanks, Matt. I looked for examples in other CMakeLists.txt files but the ones I saw changed compilation for all the executables. The 'cft_update.x' is the only one that needs the 'big_endian', so your suggestion is right on track. I will put that in and make a pull request.

We're not currently using this routine in the DAS. It's being used in MERRA2, but in the current DAS we're now using a variational bias correction formulation. So no wonder it hadn't been noticed until now.

@mathomp4
Copy link
Member

@gmao-msienkie Ah okay. I just figured the CVS/GNUmake version was compiling everything with BIG_ENDIAN, so I decided to err on the side of caution.

@gmao-msienkie
Copy link
Contributor Author

gmao-msienkie commented Apr 13, 2021

OK. I tried adding your suggestion but I don't think it worked. So I decided to copy this from another CMakeLists.txt file

if (CMAKE_Fortran_COMPILER_ID MATCHES Intel)
string (REPLACE "${FPE0}" "${BIG_ENDIAN} ${FPE0}" CMAKE_Fortran_FLAGS_RELEASE ${CMAKE_Fortran_FLAGS_RELEASE})
endif ()

and was able to run the program. (Darn, can't get the formatting right...)
I was laughing at my "cargo cult" mentality - I know nothing about using cmake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants