Skip to content

Commit

Permalink
Merge pull request #1910 from islas/definesAndSyntaxAlignCMake
Browse files Browse the repository at this point in the history
Adjust #defines to accommodate future CMake build
  • Loading branch information
islas authored Jan 11, 2024
2 parents 418e2f4 + fc27eaf commit f81f982
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 15 deletions.
10 changes: 5 additions & 5 deletions dyn_em/module_advect_em.F
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

!WRF:MODEL_LAYER:DYNAMICS
!
#if ( defined(ADVECT_KERNEL) )
#ifdef ADVECT_KERNEL
! cpp -traditional-cpp -P -DADVECT_KERNEL module_advect_em.F > advection_kernel.f90
! gfortran -ffree-form -ffree-line-length-none advection_kernel.f90
! ./a.out
Expand Down Expand Up @@ -111,7 +111,7 @@ SUBROUTINE column (loop , data_list, its,ite)

END SUBROUTINE column
!----------------------------------------------------------------
#elif ( ! defined(ADVECT_KERNEL) )
#else

MODULE module_advect_em

Expand Down Expand Up @@ -4357,7 +4357,7 @@ SUBROUTINE advect_scalar ( field, field_old, tendency, &
ENDIF vert_order_test
END SUBROUTINE advect_scalar
#if ( ! defined(ADVECT_KERNEL) )
#ifndef ADVECT_KERNEL
!---------------------------------------------------------------------------------
Expand Down Expand Up @@ -10543,7 +10543,7 @@ END SUBROUTINE advect_scalar_mono

!-----------------------------------------------------------

#if ( defined(ADVECT_KERNEL) )
#ifdef ADVECT_KERNEL

END MODULE advection_kernel
!================================================================
Expand Down Expand Up @@ -10851,7 +10851,7 @@ PROGRAM feeder

END PROGRAM feeder
#endif
#if ( !defined(ADVECT_KERNEL) )
#ifndef ADVECT_KERNEL

!---------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion external/atm_ocn/cmpcomm.F
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined( DM_PARALLEL )
#ifdef DM_PARALLEL
MODULE CMP_COMM

implicit none
Expand Down
6 changes: 3 additions & 3 deletions external/io_adios2/wrf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,9 @@ subroutine Transpose(IO,MemoryOrder,di, Field,l1,l2,m1,m2,n1,n2 &

call LowerCase(MemoryOrder,MemOrd)
select case (MemOrd)

!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))
! Cannot use following define due to gfortran cpp traditional mode concatenation limitations
!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))
case ('xzy')
#undef DFIELD
#define DFIELD XField(1:di,XDEX(i,k,j))
Expand Down
4 changes: 2 additions & 2 deletions external/io_netcdf/wrf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ subroutine Transpose(IO,MemoryOrder,di, Field,l1,l2,m1,m2,n1,n2 &

call LowerCase(MemoryOrder,MemOrd)
select case (MemOrd)

! Cannot use following define due to gfortran cpp traditional mode concatenation limitations
!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))

Expand Down Expand Up @@ -940,7 +940,7 @@ subroutine TransposeToR4(IO,MemoryOrder,di, Field,l1,l2,m1,m2,n1,n2 &

call LowerCase(MemoryOrder,MemOrd)
select case (MemOrd)

! Cannot use following define due to gfortran cpp traditional mode concatenation limitations
!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))

Expand Down
4 changes: 2 additions & 2 deletions external/io_netcdfpar/wrf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ subroutine Transpose(IO,MemoryOrder,di, Field,l1,l2,m1,m2,n1,n2 &

call LowerCase(MemoryOrder,MemOrd)
select case (MemOrd)

! Cannot use following define due to gfortran cpp traditional mode concatenation limitations
!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))

Expand Down Expand Up @@ -953,7 +953,7 @@ subroutine TransposeToR4a(IO,MemoryOrder,di, Field,l1,l2,m1,m2,n1,n2 &

call LowerCase(MemoryOrder,MemOrd)
select case (MemOrd)

! Cannot use following define due to gfortran cpp traditional mode concatenation limitations
!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))

Expand Down
2 changes: 1 addition & 1 deletion external/io_pnetcdf/wrf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ subroutine Transpose(IO,MemoryOrder,di, Field,l1,l2,m1,m2,n1,n2 &

call LowerCase(MemoryOrder,MemOrd)
select case (MemOrd)

! Cannot use following define due to gfortran cpp traditional mode concatenation limitations
!#define XDEX(A,B,C) A-A ## 1+1+(A ## 2-A ## 1+1)*((B-B ## 1)+(C-C ## 1)*(B ## 2-B ## 1+1))
! define(`XDEX',($1-``$1''1+1+(``$1''2-``$1''1+1)*(($2-``$2''1)+($3-``$3''1)*(``$2''2-``$2''1+1))))

Expand Down
4 changes: 3 additions & 1 deletion frame/module_configure.F
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ SUBROUTINE init_module_scalar_tables
END SUBROUTINE init_module_scalar_tables
END MODULE module_scalar_tables

#if( WRF_CHEM == 1 && WRF_KPP == 1 )
#ifdef WRF_CHEM
#ifdef WRF_KPP
MODULE module_irr_diag

INTEGER, parameter :: max_eqn = 1200
Expand Down Expand Up @@ -45,6 +46,7 @@ END SUBROUTINE init_module_irr_diag

END MODULE module_irr_diag
#endif
#endif

MODULE module_configure

Expand Down
5 changes: 5 additions & 0 deletions phys/module_mp_SBM_polar_radar.F
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ SUBROUTINE SBM_polar_radar
dummy = 1
END SUBROUTINE SBM_polar_radar
END MODULE module_mp_SBM_polar_radar

! Stub module
module scatt_tables
end module scatt_tables

#else
!******************
module scatt_tables
Expand Down
14 changes: 14 additions & 0 deletions phys/module_mp_fast_sbm.F
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ SUBROUTINE SBM_fast
dummy = 1
END SUBROUTINE SBM_fast
END MODULE module_mp_fast_sbm

! Stub modules
module module_mp_SBM_BreakUp
end module module_mp_SBM_BreakUp

module module_mp_SBM_Collision
end module module_mp_SBM_Collision

module module_mp_SBM_Auxiliary
end module module_mp_SBM_Auxiliary

module module_mp_SBM_Nucleation
end module module_mp_SBM_Nucleation

#else
! +-----------------------------------------------------------------------------+
! +-----------------------------------------------------------------------------+
Expand Down

0 comments on commit f81f982

Please sign in to comment.