bug in 2D compilations and a fix

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
jpringle
Posts: 109
Joined: Sun Jul 27, 2003 6:49 pm
Location: UNH, USA

bug in 2D compilations and a fix

#1 Unread post by jpringle »

Dear all --

There is a bug in post_initial.F that causes the compilation of 2D runs to fail. The easiest way to duplicate this run is to set the "canyon" test case to its 2D limit by altering its build_roms.sh to remove the "-DSOLVE3D" option in the line

Code: Select all

export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DSOLVE3D"
When the model is built in the 2D limit it will fail with the error

Code: Select all

-O3 -ffast-math -fopenmp -static-libgcc post_initial.f90
post_initial.f90:22:32:

   22 |       USE set_depth_mod,  ONLY : set_depth
      |                                1
Error: Symbol ‘set_depth’ referenced at (1) not found in module ‘set_depth_mod’
This occurs because set_depth is not defined in set_depth_mod when SOLVE3D is not defined. To fix it, one must just remove the importing and calling of set_depth in post_initial.F when SOLVE3D is not defined. Attached is a diff which fixes this problem.

Code: Select all

*** post_initial.F_original     2024-12-20 15:35:48.029287130 +0000
--- post_initial.F_jamieFix     2024-12-20 15:35:03.256215434 +0000
***************
*** 24,30 ****
--- 24,32 ----
  # endif
  !
        USE ini_fields_mod, ONLY : ini_fields, ini_zeta
+ #ifdef SOLVE3D
        USE set_depth_mod,  ONLY : set_depth
+ #endif
  !
        implicit none
  !
***************
*** 51,58 ****
  !-----------------------------------------------------------------------
  !
        DO tile=first_tile(ng),last_tile(ng),+1
!         CALL ini_zeta (ng, tile, model)
!         CALL set_depth (ng, tile, model)
        END DO
  !$OMP BARRIER
  !
--- 53,62 ----
  !-----------------------------------------------------------------------
  !
        DO tile=first_tile(ng),last_tile(ng),+1
!          CALL ini_zeta (ng, tile, model)
! #ifdef SOLVE3D
!          CALL set_depth (ng, tile, model)
! #endif
        END DO
  !$OMP BARRIER
  !
Cheers,
Jamie Pringle

Post Reply