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

emcsfc_snow2mdl fails to build using GNU compiler #554

Closed
DusanJovic-NOAA opened this issue Jul 22, 2021 · 6 comments · Fixed by #583
Closed

emcsfc_snow2mdl fails to build using GNU compiler #554

DusanJovic-NOAA opened this issue Jul 22, 2021 · 6 comments · Fixed by #583
Assignees
Labels
bug Something isn't working

Comments

@DusanJovic-NOAA
Copy link
Contributor

The compile error:

/home/dusan/simple-ufs/src/preproc/sorc/emcsfc_snow2mdl.fd/snow2mdl.F90:289:53:

  289 |                      lons_mdl(ij),lats_mdl(ij),nret)
      |                                                     1
Error: There is no specific subroutine for the generic ‘gdswzd’ at (1)                                                                            
@kgerheiser
Copy link
Contributor

I have no problems building it with GNU 10.3.0.

@DusanJovic-NOAA
Copy link
Contributor Author

Looks like I get the compile error when I use the develop branch of ip lib.

@kgerheiser
Copy link
Contributor

kgerheiser commented Jul 23, 2021

Yes, ip is in a module now, and snow2mdl plays loose with type checking. I would recommend using tag v3.3.3. There's a branch of UFS_UTILS with the update that will be merged.

@GeorgeGayno-NOAA
Copy link
Collaborator

GeorgeGayno-NOAA commented Oct 8, 2021

UFS_UTILS uses ip v3.3.3 on all officially supported machines now. So can this issue be closed? Should I fix the snow2mdl code?

@DusanJovic-NOAA
Copy link
Contributor Author

UFS_UTILS uses ip v3.3.3 on all officially supported machines now. So can this issue be closed? Should I fix the snow2mdl code?

I can build UFS_UTILS using ip v3.3.3 with GNU. But related to building with GNU can you make this change:

$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c4e752f..3657c8ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
   set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
 elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
   set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
+  if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
+    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
+  endif()
   set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
   set(CMAKE_Fortran_FLAGS_DEBUG "-O1 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
 endif()

@GeorgeGayno-NOAA
Copy link
Collaborator

UFS_UTILS uses ip v3.3.3 on all officially supported machines now. So can this issue be closed? Should I fix the snow2mdl code?

I can build UFS_UTILS using ip v3.3.3 with GNU. But related to building with GNU can you make this change:

$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c4e752f..3657c8ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
   set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
 elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
   set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
+  if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
+    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
+  endif()
   set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
   set(CMAKE_Fortran_FLAGS_DEBUG "-O1 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
 endif()

Ok. I can work on this today.

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

Successfully merging a pull request may close this issue.

3 participants