Skip to content

Commit

Permalink
Merge branch 'develop' into feature/GQM
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelaccensi committed Oct 13, 2023
2 parents c43d127 + eff6686 commit 8f5d4d7
Show file tree
Hide file tree
Showing 16 changed files with 922 additions and 19 deletions.
6 changes: 3 additions & 3 deletions model/src/cmake/check_switches.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function(check_switches switches switch_files)
message(FATAL_ERROR "Switch '${valid_opt}' requires '${required_switch}' to be set")
endif()
elseif(json_type STREQUAL "ARRAY")
string(JSON n_requires_any LENGTH ${vategory} valid-options ${j_options} requries ${i_requires})
string(JSON n_requires_any LENGTH ${category} valid-options ${j_options} requires ${i_requires})
math(EXPR n_requires_any "${n_requires_any} - 1")

# Loop over array and check that one of the switches is present
Expand All @@ -70,7 +70,7 @@ function(check_switches switches switch_files)
if(NOT found)
message(FATAL_ERROR "Switch ${valid_opt} requires one of ${possible_values} to be set")
endif()

endif()
endforeach()
endif()
Expand Down Expand Up @@ -98,7 +98,7 @@ function(check_switches switches switch_files)
elseif(num_switches STREQUAL "upto2" AND n_switches_in_category GREATER 2)
message(FATAL_ERROR "Too many ${category_name} switches found (max 2)")
endif()

endforeach()

set(${switch_files} ${files} PARENT_SCOPE)
Expand Down
22 changes: 16 additions & 6 deletions model/src/cmake/switches.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
},
{
"name": "STAB3",
"requires": ["ST3", "ST4"]
"requires_any": ["ST3", "ST4"]
}
]
},
Expand Down Expand Up @@ -756,16 +756,16 @@
}
]
},
{
"name": "ddlib",
{
"name": "ddlib",
"num_switches": "upto1",
"description": "domain decomposition library",
"valid-options": [
{
{
"name": "METIS",
"requires": ["PDLIB"]
},
{
},
{
"name": "SCOTCH",
"requires": ["PDLIB"]
}
Expand Down Expand Up @@ -813,5 +813,15 @@
"name": "B4B"
}
]
},
{
"name": "ascii",
"num_switches": "upto1",
"description": "ASCII output for binary .ww3 file",
"valid-options": [
{
"name": "ASCII"
}
]
}
]
12 changes: 11 additions & 1 deletion model/src/w3gridmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ MODULE W3GRIDMD
IY2, J, JJ, IXR(4), IYR(4), ISEAI(4),&
IST, NKI, NTHI, NRIC, NRIS, I, IDFT, &
NSTAT, NBT, NLAND, NOSW, NMAPB, IMAPB
#ifdef W3_ASCII
INTEGER :: NDSMA
#endif
#ifdef W3_NL2
INTEGER :: IDEPTH
#endif
Expand Down Expand Up @@ -5939,9 +5942,16 @@ SUBROUTINE W3GRID()
!10. Write model definition file.
!
WRITE (NDSO,999)
CALL W3IOGR ( 'WRITE', NDSM )
CALL W3IOGR ( 'WRITE', NDSM &
#ifdef W3_ASCII
,NDSA=NDSMA &
#endif
)
!
CLOSE (NDSM)
#ifdef W3_ASCII
CLOSE (NDSMA)
#endif
!
GOTO 2222
!
Expand Down
3 changes: 3 additions & 0 deletions model/src/w3initmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD,
! (first).
! 11: Track information file unit number.
! 12: Track output file unit number.
! 13: Wave separation output file unit number.
! 14: Grid output file unit number.
! 15: Point output file unit number. ascii
! MTRACE I.A. I Array with subroutine tracing information.
! 1: Output unit number for trace.
! 2: Maximum number of trace prints.
Expand Down
Loading

0 comments on commit 8f5d4d7

Please sign in to comment.