Skip to content

Commit

Permalink
ww3_gse: merge develop ...
Browse files Browse the repository at this point in the history
  • Loading branch information
aronroland committed Sep 21, 2023
1 parent d51a668 commit ff00104
Show file tree
Hide file tree
Showing 74 changed files with 3,172 additions and 2,438 deletions.
30 changes: 16 additions & 14 deletions model/bin/ww3_from_ftp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ fi

dir0=$(cd $(dirname $0) > /dev/null && pwd -P)
ww3dir=$(dirname $(dirname $dir0))
#Get top level directory of ww3 from user:

#Get top level directory of ww3 from user:
echo -e "\n\n This script will download data from the ftp for WAVEWATCH III "
if [ "$interactive" = "n" ]
then
Expand All @@ -55,19 +55,19 @@ else
echo -e "Enter the absolute or relative path to the main/top directory, "
echo -e "this would be '../../' if in the model/bin directory "
echo -e "or './' if already in the top/main directory:"
read ww3dir
read ww3dir
fi

#Move to top level directory of ww3:
cd $ww3dir
#Move to top level directory of ww3:
cd $ww3dir

#Download from ftp and uptar:
echo -e "Downloading and untaring file from ftp:"
#Download from ftp and uptar:
echo -e "Downloading and untaring file from ftp:"
wget --no-check-certificate https://ftp.emc.ncep.noaa.gov/static_files/public/WW3/ww3_from_ftp.${ww3ver}.tar.gz
tar -xvzf ww3_from_ftp.${ww3ver}.tar.gz

#Move regtest info from data_regtests to regtests:
echo -e "Moving data from data_regtests to regtests"
echo -e "Moving data from data_regtests to regtests"
cp -r data_regtests/ww3_tp2.18/input/*.nc regtests/ww3_tp2.18/input/
cp -r data_regtests/ww3_tp2.15/input/wind.nc regtests/ww3_tp2.15/input/
cp -r data_regtests/ww3_tp2.15/input/*.nc regtests/ww3_tp2.15/input_rho/
Expand All @@ -93,7 +93,7 @@ if [ ! -d regtests/ww3_tp2.14/input/oasis3-mct/doc ]
then
mkdir regtests/ww3_tp2.14/input/oasis3-mct/doc
fi
cp -r data_regtests/ww3_tp2.14/input/oasis3-mct/doc/* regtests/ww3_tp2.14/input/oasis3-mct/doc/
cp -r data_regtests/ww3_tp2.14/input/oasis3-mct/doc/* regtests/ww3_tp2.14/input/oasis3-mct/doc/
cp -r data_regtests/ww3_tp2.14/input/toy/*.nc.OAS*CM regtests/ww3_tp2.14/input/toy/
cp -r data_regtests/ww3_tp2.14/input/toy/r-toy.nc.OASACM regtests/ww3_tp2.14/input/toy/r-toy.nc.OASACM2
cp -r data_regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM2
Expand All @@ -102,13 +102,15 @@ cp -r data_regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM regtests/ww
cp -r data_regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM regtests/ww3_tp2.14/input/toy/toy_coupled_field.nc.OASACM6
cp -r data_regtests/ww3_tp2.14/input/toy/*.nc regtests/ww3_tp2.14/input/toy/
cp -r data_regtests/ww3_tp2.17/input/* regtests/ww3_tp2.17/input/
cp -r data_regtests/ww3_tp2.19/input/* regtests/ww3_tp2.19/input/
cp -r data_regtests/ww3_tp2.21/input/* regtests/ww3_tp2.21/input/
cp -r data_regtests/mww3_test_09/input/* regtests/mww3_test_09/input/
cp -r data_regtests/ww3_ufs1.1/input/* regtests/ww3_ufs1.1/input/
cp -r data_regtests/ww3_ufs1.1/input_unstr/* regtests/ww3_ufs1.1/input_unstr/
cp -r data_regtests/ww3_ufs1.1/input/*.nc regtests/ww3_ufs1.2/input/
cp -r data_regtests/ww3_ufs1.2/input/* regtests/ww3_ufs1.2/input/
cp -r data_regtests/ww3_ufs1.3/input/*nc regtests/ww3_ufs1.3/input/
#Do you want to clean up (aka delete tar file, delete the data_regtests directory)
#Do you want to clean up (aka delete tar file, delete the data_regtests directory)
echo -e "\n\n Do you want to delete the tar file ww3_from_ftp.${ww3ver}.tar.gz [y|n]: "
if [ "$interactive" = "n" ]
then
Expand All @@ -118,10 +120,10 @@ else
fi
if [ "${keep}" = "N" ] || [ "${keep}" = "n" ]
then
echo -e '\n Deleting tar file ww3_from_ftp.${ww3ver}.tar.gz'
echo -e "\n Deleting tar file ww3_from_ftp.${ww3ver}.tar.gz"
rm ww3_from_ftp.${ww3ver}.tar.gz
else
echo -e ' Not deleting tar file.'
echo -e ' Not deleting tar file.'
fi

echo -e "\n\n Files were copied from the data_regtests to the regtests folder."
Expand All @@ -137,9 +139,9 @@ then
echo -e '\n Deleting the data_regtests folder'
rm -rf data_regtests
else
echo -e ' Not deleting the data_regtests folder.'
echo -e ' Not deleting the data_regtests folder.'
fi

#move back to original directory:
#move back to original directory:
cd $curr_dir
echo -e "End of ww3_from_ftp.sh"
3 changes: 2 additions & 1 deletion model/ci/spack_gnu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ spack:
- g2@3.4.5
- bacio@2.4.1
- w3emc@2.9.2
- esmf@8.1.1~pio~pnetcdf~xerces
- parallelio@2.5.9+fortran~pnetcdf
- esmf@8.4.2~debug~xerces+external-parallelio
view: true
concretizer:
unify: when_possible
11 changes: 6 additions & 5 deletions model/ci/spack_intel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ spack:
providers:
mpi: [intel-oneapi-mpi]
specs:
- netcdf-c@4.7.4~dap
- netcdf-fortran@4.5.3
- bacio@2.4.1
- g2@3.4.5
- metis@5.1.0~shared
- parmetis@4.0.3~shared
- scotch@7.0.1+mpi+metis~shared
- netcdf-c@4.7.4~dap
- netcdf-fortran@4.5.3
- jasper@2.0.32
- g2@3.4.5
- bacio@2.4.1
- w3emc@2.9.2
- esmf@8.1.1~pio~pnetcdf~xerces
- parallelio@2.5.9+fortran~pnetcdf
- esmf@8.4.2~debug~xerces+external-parallelio
- intel-oneapi-mpi %intel
view: true
concretizer:
Expand Down
7 changes: 5 additions & 2 deletions model/inp/ww3_gint.inp
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
$ -------------------------------------------------------------------- $
$ WAVEWATCH III Grid integration input file $
$ -------------------------------------------------------------------- $
$ Time, time increment and number of outputs
$ Time, time increment and number of outputs, and optional T/F
$ option (default is T) to indicate out_grd (T) or restart (F)
$ This option for example allows you to create a regional grid from global
$ Note, there is no interpolation in spectral space only geographic
$
19680606 060000 10800. 1
19680606 060000 10800. 1 T
$
$ Total number of grids (NGR). The code assumes that the first NGR-1
$ grids are the input grids and the last grid is the target grid in
Expand Down
61 changes: 36 additions & 25 deletions model/inp/ww3_grid.inp
Original file line number Diff line number Diff line change
Expand Up @@ -305,33 +305,44 @@ $ limitation and the GSE alleviation.
$
$ Unstructured grids ------------------------------------------------ $
$ UNST parameters : Namelist UNST
$ UGOBCAUTO : TRUE: OBC points are taken from type 15 elements
$ FALSE: OBC points must be listed in ww3_grid.inp
$ UGOBCDEPTH : Threshold ( < 0) depth for OBC points if UGOBCAUTO is TRUE
$ UGOBCFILE : Reading boundary files from a file
$ EXPFSN : Activation of N scheme (only one of the below 4, True - Active, False - not active)
$ UGBCCFL : Turns on/off (TRUE/FALSE) the computation of the CFL number on the physical domain boundary.
$ If FALSE the explicit scheme can be much faster though stability is not guaranteed
$ (default TRUE)
$ UGOBCAUTO : TRUE: OBC points are taken from type 15 elements (default)
$ FALSE: OBC points must be listed in ww3_grid.inp
$ UGOBCDEPTH : Threshold ( < 0) depth (default -10) for OBC points if UGOBCAUTO is TRUE
$ UGOBCFILE : File name of file for reading boudary (default 'unset')
$
$ The following are TRUE/FALSE variables and only one can be TRUE.
$ By default, EXPFSN is TRUE and must be set to false to activate another option
$ EXPFSN : Activation of N scheme (default option)
$ EXPFSPSI : Activation of PSI scheme
$ EXPFSFCT : Activation of FCT scheme
$ IMPFSN : Activation of N implicit scheme
$ EXPTOTAL : Activation of the Block explicit N scheme solver
$ IMPTOTAL : Activation of fully implicit scheme | Non splitting
$ IMPREFRACTION : Turn on implicit freq. shift (only with imptotal)
$ IMPFREQSHIFT : Turn on implicit freq. shift terms (only with imptotal)
$ IMPSOURCE : Turn on implicit source terms (only with imptotal)
$ JGS_TERMINATE_MAXITER : max. Number of iterations
$ JGS_TERMINATE_DIFFERENCE : Terminate based on the total change of the unweightet sum of wave action
$ JGS_TERMINATE_NORM : Terminate based on the norm of the solution
$ JGS_USE_JACOBI : Use Jacobi solver family
$ JGS_BLOCK_GAUSS_SEIDEL : Use Block Gauss Seidel method for imptotal instead of the conservative jacobi iterator.
$ JGS_MAXITER : max. Number of solver iterations
$ JGS_PMIN : % of grid points that do not need to converge during solver iteration.
$ JGS_DIFF_THR : implicit solver threshold for JGS_TERMINATE_DIFFERENCE
$ JGS_NORM_THR : terminate based on the norm of the solution
$ JGS_LIMITER : use total (quasi-steady: limits whole equation) instead of local limiter (un-steady: limits only source terms)
$ JGS_LIMITER_FUNC : 1 - old limiter; 2 - alternatnive limiter
$ SETUP_APPLY_WLV : Compute wave setup (experimental)
$ SOLVERTHR_SETUP : Solver threshold for setup computations
$ CRIT_DEP_SETUP : Critical depths for setup computations
$ IMPFSN : Activation of N implicit scheme
$ EXPTOTAL : Activation of Block explicit N scheme solver
$ IMPTOTAL : Activation of fully implicit scheme, non splitting
$
$ The following TRUE/FALSE variables are only for IMPTOTAL=TRUE
$ IMPREFRACTION : Turn on implicit freq. shift (default FALSE)
$ IMPFREQSHIFT : Turn on implicit freq. shift terms (default FALSE)
$ IMPSOURCE : Turn on implicit source terms (default FALSE)
$
$ JGS_TERMINATE_MAXITER : Terminate based on max number of iterations (TRUE/FALSE, default TRUE)
$ JGS_TERMINATE_DIFFERENCE : Terminate based on the total change of the unweightet sum of wave action (TRUE/FALSE, default TRUE)
$ JGS_TERMINATE_NORM : Terminate based on the norm of the solution (TRUE/FALSE, default FALSE)
$ JGS_USE_JACOBI : Use Jacobi solver family (TRUE/FALSE, default TRUE)
$ JGS_BLOCK_GAUSS_SEIDEL : Use Block Gauss Seidel method for imptotal instead of the conservative jacobi iterator. (TRUE/FALSE, default TRUE)
$ JGS_MAXITER : Max. Number of solver iterations for JGS_TERMINATE_MAXITER (integer, default 100)
$ JGS_PMIN : % of grid points that do not need to converge during solver iteration (real, default 1)
$ JGS_DIFF_THR : Implicit solver threshold for JGS_TERMINATE_DIFFERENCE (real, default 1.0e-10)
$ JGS_NORM_THR : Norm of the solution for JGS_TERMINATE_NORM (real, default 1.0e-20)
$ JGS_LIMITER : TRUE: Use total (quasi-steady: limits whole equation) instead of local limiter (un-steady: limits only source terms)
$ FALSE: default
$ JGS_LIMITER_FUNC : 1 - old limiter (default)
$ 2 - alternatnive limiter
$ SETUP_APPLY_WLV : Compute wave setup (TRUE/FALSE, default TRUE)
$ SOLVERTHR_SETUP : Solver threshold for setup computations (default 1E-6)
$ CRIT_DEP_SETUP : Critical depth for setup computations (default 0.1)

$
$ SMC grid propagation : Namelist PSMC and default values
Expand Down
4 changes: 0 additions & 4 deletions model/nml/namelists.nml
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,6 @@ $ SETUP_APPLY_WLV : Compute wave setup (experimental)
$ SOLVERTHR_SETUP : Solver threshold for setup computations
$ CRIT_DEP_SETUP : Critical depths for setup computations
$
$ JGS_LGSE = T : Turn off/on GSE correction on unstructured grids
$ JGS_GSE_TS = 350000. : Swell age parameter see manual
$
$
$ SMC grid propagation : Namelist PSMC and default values
$ CFLTM : Maximum CFL no. for propagation, 0.7
$ DTIME : Swell age for diffusion term (s), 0.0
Expand Down
2 changes: 1 addition & 1 deletion model/src/PDLIB/yownodepool.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module yowNodepool

!> coordinates of the local + ghost nodes. range [1:npa]
real(rkind), public, target, allocatable :: x(:), y(:), z(:)
real(rkind), public, target, allocatable :: PDLIB_SI(:), PDLIB_TRIA(:), PDLIB_TRIA03(:), PDLIB_IEN(:,:), PDLIB_IEND(:,:,:)
real(rkind), public, target, allocatable :: PDLIB_SI(:), PDLIB_TRIA(:), PDLIB_TRIA03(:), PDLIB_IEN(:,:)
integer, public, target, allocatable :: PDLIB_CCON(:), PDLIB_IA(:), PDLIB_JA(:)
integer, public, target, allocatable :: PDLIB_IA_P(:), PDLIB_JA_P(:), PDLIB_JA_IE(:,:,:)
integer, public, target, allocatable :: PDLIB_POS_CELL(:), PDLIB_IE_CELL(:)
Expand Down
14 changes: 2 additions & 12 deletions model/src/PDLIB/yowpdlibmain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1306,13 +1306,13 @@ subroutine ComputeTRIA_IEN_SI_CCON
use yowerr, only: parallel_abort
use yowDatapool, only: myrank
use yowNodepool, only: np_global, np, iplg, t_Node, ghostlg, ng, npa
use yowNodepool, only: x, y, z, PDLIB_SI, PDLIB_IEN, PDLIB_IEND, PDLIB_TRIA, PDLIB_CCON, PDLIB_TRIA03
use yowNodepool, only: x, y, z, PDLIB_SI, PDLIB_IEN, PDLIB_TRIA, PDLIB_CCON, PDLIB_TRIA03

integer I1, I2, I3, stat, IE, NI(3)
real :: DXP1, DXP2, DXP3, DYP1, DYP2, DYP3, DBLTMP, TRIA03
logical :: CROSSES_DATELINE

allocate(PDLIB_SI(npa), PDLIB_CCON(npa), PDLIB_IEN(6,ne), PDLIB_IEND(3,3,ne), PDLIB_TRIA(ne), PDLIB_TRIA03(ne), stat=stat)
allocate(PDLIB_SI(npa), PDLIB_CCON(npa), PDLIB_IEN(6,ne), PDLIB_TRIA(ne), PDLIB_TRIA03(ne), stat=stat)
if(stat/=0) call parallel_abort('SI allocation failure')

PDLIB_SI(:) = 0.0d0 ! Median Dual Patch Area of each Node
Expand Down Expand Up @@ -1350,16 +1350,6 @@ subroutine ComputeTRIA_IEN_SI_CCON
WRITE(*,*) 'AREA SMALLER ZERO IN PDLIB', IE, NE, PDLIB_TRIA(IE)
STOP
ENDIF
PDLIB_IEND(1,1,IE) = DOT_PRODUCT(PDLIB_IEN(1:2,IE),PDLIB_IEN(1:2,IE)) ! Tomaich. eq. 3.19 n1 * n1 etc.
PDLIB_IEND(1,2,IE) = DOT_PRODUCT(PDLIB_IEN(1:2,IE),PDLIB_IEN(3:4,IE))
PDLIB_IEND(1,3,IE) = DOT_PRODUCT(PDLIB_IEN(1:2,IE),PDLIB_IEN(5:6,IE))
PDLIB_IEND(2,1,IE) = DOT_PRODUCT(PDLIB_IEN(3:4,IE),PDLIB_IEN(1:2,IE))
PDLIB_IEND(2,2,IE) = DOT_PRODUCT(PDLIB_IEN(3:4,IE),PDLIB_IEN(3:4,IE))
PDLIB_IEND(2,3,IE) = DOT_PRODUCT(PDLIB_IEN(3:4,IE),PDLIB_IEN(5:6,IE))
PDLIB_IEND(3,1,IE) = DOT_PRODUCT(PDLIB_IEN(5:6,IE),PDLIB_IEN(1:2,IE))
PDLIB_IEND(3,2,IE) = DOT_PRODUCT(PDLIB_IEN(5:6,IE),PDLIB_IEN(3:4,IE))
PDLIB_IEND(3,3,IE) = DOT_PRODUCT(PDLIB_IEN(5:6,IE),PDLIB_IEN(5:6,IE))


PDLIB_CCON(I1) = PDLIB_CCON(I1) + 1
PDLIB_CCON(I2) = PDLIB_CCON(I2) + 1
Expand Down
42 changes: 42 additions & 0 deletions model/src/gx_outf.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
!> @file
!> @brief Generate GrADS input files from raw WAVEWATCH data file.
!>
!> @author H. L. Tolman
!> @author A. Chawla
!> @author J.H.G.M. Alves
!> @date 22-Mar-2021
!>
#include "w3macros.h"

!/ ------------------------------------------------------------------- /
!>
!> @brief Generate GrADS input files from raw WAVEWATCH data file.
!>
!> @details
!> Data is read from the grid output file out_grd.ww3 (raw data)
!> and from the file gx_outf.inp ( NDSI, output requests ).
!> Model definition and raw data files are read using WAVEWATCH III
!> subroutines.
!>
!> Output files are ww3.ctl and ww3.grads. The output files
!> contains a land-sea map, followed by requested fields. See the
!> control file for the names of the fields.
!>
!> @author H. L. Tolman
!> @author A. Chawla
!> @author J.H.G.M. Alves
!> @date 22-Mar-2021
!>
!> @copyright Copyright 2009-2022 National Weather Service (NWS),
!> National Oceanic and Atmospheric Administration. All rights
!> reserved. WAVEWATCH III is a trademark of the NWS.
!> No unauthorized use without permission.
!>
PROGRAM GXOUTF
!/
!/ +-----------------------------------+
Expand Down Expand Up @@ -740,6 +772,16 @@ PROGRAM GXOUTF
!/
CONTAINS
!/ ------------------------------------------------------------------- /
!>
!> @brief Perform actual output for GrADS postprocessing.
!>
!> @param[in] NX Grid dimensions.
!> @param[in] NY Grid dimensions.
!> @param[in] NSEA Number of sea points.
!>
!> @author H. L. Tolman
!> @date 22-Mar-2021
!>
SUBROUTINE GXEXGO ( NX, NY, NSEA )
!/
!/ +-----------------------------------+
Expand Down
28 changes: 28 additions & 0 deletions model/src/gx_outp.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
!> @file
!> @brief Post-processing of point output for GrADS post-processing.
!>
!> @author H. L. Tolman
!> @author J.H. Alves
!> @author F. Ardhuin
!> @date 27-Aug-2015
!>

#include "w3macros.h"
!/ ------------------------------------------------------------------- /
!>
!> @brief Post-processing of point output for GrADS post-processing.
!>
!> @author H. L. Tolman
!> @author J.H. Alves
!> @author F. Ardhuin
!> @date 27-Aug-2015
!>
!> @copyright Copyright 2009-2022 National Weather Service (NWS),
!> National Oceanic and Atmospheric Administration. All rights
!> reserved. WAVEWATCH III is a trademark of the NWS.
!> No unauthorized use without permission.
!>
PROGRAM GXOUTP
!/
!/ +-----------------------------------+
Expand Down Expand Up @@ -539,6 +561,12 @@ PROGRAM GXOUTP
!/
CONTAINS
!/ ------------------------------------------------------------------- /
!>
!> @brief Perform actual point output.
!>
!> @author H. L. Tolman
!> @date 16-Jul-2012
!>
SUBROUTINE GXEXPO
!/
!/ +-----------------------------------+
Expand Down
Loading

0 comments on commit ff00104

Please sign in to comment.