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

Update WW3 swtiches and replace ww3_outp utility with ww3_ounp #84

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions WW3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Global definitions, flags, etc

## List of switches
list(APPEND switches "CESMCOUPLED" "NCO" "DIST" "MPI" "PR3" "UQ" "FLX4" "SEED" "ST6" "STAB0" "NL1" "BT1" "DB1" "MLIM" "TR0" "BS0" "RWND" "WNX1" "WNT1" "CRX1" "CRT1" "O0" "O1" "O2" "O3" "O4" "O5" "O6" "O7" "O14" "O15" "IS0" "REF0" "NOGRB" "IC0")
list(APPEND switches "CESMCOUPLED" "NCO" "DIST" "MPI" "PR1" "FLX4" "ST6" "STAB0" "LN1" "NL1" "BT1" "DB1" "MLIM" "TR0" "BS0" "RWND" "WNX1" "WNT1" "CRX1" "CRT1" "O0" "O1" "O2" "O3" "O4" "O5" "O6" "O7" "O14" "O15" "IS0" "REF0" "NOGRB" "IC0")

## Global compile definitions
foreach(switch ${switches})
Expand Down Expand Up @@ -78,7 +78,6 @@ target_sources(OM3_ww3 PRIVATE
WW3/model/src/wmmdatmd.F90
WW3/model/src/wmunitmd.F90
WW3/model/src/wmupdtmd.F90
WW3/model/src/wmwavemd.F90
WW3/model/src/w3tidemd.F90
WW3/model/src/wav_grdout.F90
WW3/model/src/w3iogoncdmd.F90
Expand All @@ -93,6 +92,11 @@ target_sources(OM3_ww3 PRIVATE
${switch_files}
)

target_include_directories(OM3_ww3 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/WW3/model/src)

#patched source
add_patched_source(OM3_ww3 WW3/model/src/w3wavemd.F90)

## Utilities

# ww3_grid
Expand Down Expand Up @@ -131,17 +135,17 @@ set_target_properties(OM3_ww3_ounf PROPERTIES
)
target_link_libraries(OM3_ww3_ounf PRIVATE OM3_ww3)

# ww3_outp
add_executable(OM3_ww3_outp WW3/model/src/ww3_outp.F90)
set_target_properties(OM3_ww3_outp PROPERTIES
# ww3_ounp
add_executable(OM3_ww3_ounp WW3/model/src/ww3_ounp.F90)
set_target_properties(OM3_ww3_ounp PROPERTIES
LINKER_LANGUAGE Fortran
OUTPUT_NAME ww3_outp
OUTPUT_NAME ww3_ounp
)
target_link_libraries(OM3_ww3_outp PRIVATE OM3_ww3)
target_link_libraries(OM3_ww3_ounp PRIVATE OM3_ww3)


## Installs
if(OM3_BIN_INSTALL)
install(TARGETS OM3_ww3_grid OM3_ww3_strt OM3_ww3_ounf OM3_ww3_outp
install(TARGETS OM3_ww3_grid OM3_ww3_strt OM3_ww3_ounf OM3_ww3_ounp
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
31 changes: 31 additions & 0 deletions WW3/patches/w3wavemd.F90.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- WW3/model/src/w3wavemd.F90 2023-10-31 16:49:44.000000000 +1100
ezhilsabareesh8 marked this conversation as resolved.
Show resolved Hide resolved
+++ WW3/model/src/w3wavemd_modified.F90 2023-11-02 11:18:38.000000000 +1100
@@ -2413,6 +2413,7 @@
end IF

do_w3outg = .false.
+
if (w3_cesmcoupled_flag .and. histwr) then
do_w3outg = .true.
else if ( LOCAL .AND. (FLOUTG .OR. FLOUTG2) ) then
@@ -2562,11 +2563,7 @@
if (w3_sbs_flag) then
do_gridded_output = ( j .eq. 1 ) .or. ( j .eq. 7 )
else
- if (w3_cesmcoupled_flag) then
- do_gridded_output = ( j .eq. 1 ) .and. histwr
- else
- do_gridded_output = ( j .eq. 1 )
- end if
+ do_gridded_output = ( j .eq. 1 )
end if
do_point_output = (j .eq. 2)
do_track_output = (j .eq. 3)
@@ -2587,6 +2584,7 @@
TOUT(:) = TONEXT(:,J)
DTTST = DSEC21 ( TIME, TOUT )
!
+
IF ( DTTST .EQ. 0. ) THEN
if (do_gridded_output) then
if (user_netcdf_grdout) then