Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:develop' into feature/gpu/w3srce_refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ukmo-ccbunney authored Dec 12, 2023
2 parents dd7ad88 + ff1b9e9 commit 0fa7e36
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 34 deletions.
78 changes: 71 additions & 7 deletions model/src/w3iopomd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1023,17 +1023,81 @@ SUBROUTINE W3IOPE ( A )
!/ End of W3IOPE ----------------------------------------------------- /
!/
END SUBROUTINE W3IOPE
!/ ------------------------------------------------------------------- /

!> Read or write point output.
!>
!> @brief Read/write point output.
!> This subroutine can either read or write the point output file,
!> depending on the value of the first parameter.
!>
!> @param[in] INXOUT Test string for read/write.
!> @param[in] NDSOP File unit number.
!> @param[out] IOTST Test indictor for reading.
!> @param[in] IMOD Model number for W3GDAT etc.
!> When reading, the entire file is read with one call to this
!> subroutine.
!>
!> @author H. L. Tolman @date 25-Jul-2006
!> When writing, this subroutine can either write one timestep or
!> the whole model run. This is an option in the input file. If the
!> entire model run is to be written, then OFILES(2) is 0. If only
!> one timestep is to be written, then OFILES(2) is 1.
!>
!> If OFILES(2) is 0, the output file is names out_pnt.ww3. If
!> OFILES(2) is 1, the output file is named TIMETAG.out_pnt.ww3.
!>
!> The format of the point output file is:
!> Size (bytes) | Type | Variable | Meaning
!> -------------|------|----------|--------
!> 40 | character*40 | IDTST | ID string
!> 4 | integer | VERTST | Model definition file version number
!> 4 | integer | NK | Dimension of frequency
!> 4 | integer | MTH | Directionality of the frequency
!> 4 | integer | NOPTS | Number of output points.
!> 8*NOPTS | integer(2,NOPTS) | PTLOC | Point locations
!> 7*NOPTS | character*7 | PTNME | Point names
!> 8 | integer(2) | TIME | Time
!> reclen*NOPTS | * | * | records
!>
!> Each record contains:
!> Size (bytes) | Type | Variable | Meaning
!> -------------|------|----------|--------
!> 4 | integer | IW | Number of water points in interpolation box for output point.
!> 4 | integer | II | Number of ice points in interpolation box for output point.
!> 4 | integer | IL | Number of land points in interpolation box for output point.
!> 4 | real | DPO | Interpolated depths.
!> 4 | real | WAO | Interpolated wind speeds.
!> 4 | real | WDO | Interpolated wind directions.
!> 4 | real | TAUAO | (W3_FLX5 only) Interpolated atmospheric stresses.
!> 4 | real | TAUDO | (W3_FLX5 only) Interpolated atmospheric stress directions.
!> 4 | real | DAIRO | (W3_FLX5 only) Interpolated rho atmosphere.
!> 4 | real | ZET_SETO | (W3_SETUP only) Used for wave setup.
!> 4 | real | ASO | Interpolated air-sea temperature difference
!> 4 | real | CAO | Interpolated current speeds.
!> 4 | real | CDO | Interpolated current directions.
!> 4 | real | ICEO | Interpolated ice concentration.
!> 4 | real | ICEHO | Interpolated ice thickness.
!> 4 | real | ICEFO | Interpolated ice floe.
!> 13 | char | GRDID | Originating grid ID
!> 4 | real | SPCO(J,I),J=1,NSPEC | Output spectra
!>
!> In the event of error, EXTCDE() will be called with the following exit codes:
!> - 1 INXOUT must be 'READ' or 'WRITE'.
!> - 2 Unexpectedly changed from WRITE to READ in subsequent call.
!> - 10 Unexpected IDSTR
!> - 11 Unexpected VEROPT
!> - 12 Unexpected MK or MTH
!> - 20 Error opening file.
!> - 21 Unexpected end of file during read.
!> - 22 Error reading file.
!> - 23 Unexpected end of file during read.
!>
!> @param[in] INXOUT String indicating read/write. Must be 'READ' or
!> 'WRITE'.
!> @param[in] NDSOP File unit number.
!> @param[out] IOTST Error code:
!> - 0 No error.
!> - -1 Unexpected end of file when reading.
!> @param[in] IMOD Model number for W3GDAT etc.
#ifdef W3_ASCII
!> @param[in] NDSOA File unit number for ASCII output.
#endif
!>
!> @author H. L. Tolman @date 25-Jul-2006
SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD &
#ifdef W3_ASCII
,NDSOA &
Expand Down
51 changes: 24 additions & 27 deletions regtests/bin/matrix_cmake_ncep
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ EOF
# Convert main_dir to absolute path
main_dir="`cd $main_dir 1>/dev/null 2>&1 && pwd`"

# Module Versions from HPC-Stack that are common for all platforms
modnetcdf='netcdf/4.7.4'
modjasper='jasper/2.0.25'
modzlib='zlib/1.2.11'
# Module Versions from spack-stack that are common for all platforms
modnetcdfc='netcdf-c/4.9.2'
modnetcdff='netcdf-fortran/4.6.0'
modjasper='jasper/2.0.32'
modzlib='zlib/1.2.13'
modpng='libpng/1.6.37'
modhdf5='hdf5/1.10.6'
modhdf5='hdf5/1.14.0'
modbacio='bacio/2.4.1'
modg2='g2/3.4.5'
modw3emc='w3emc/2.9.2'
modesmf='esmf/8.3.0b09'
modw3emc='w3emc/2.10.0'
modesmf='esmf/8.4.2'
modscotch='scotch/7.0.4'

# Set batchq queue, choose modules and other custom variables to fit system and
# to define headers etc (default to original version if empty)
Expand All @@ -62,25 +64,21 @@ EOF
batchq='slurm'
basemodcomp='intel/2022.1.2'
basemodmpi='impi/2022.1.2'
hpcstackpath='/scratch1/NCEPDEV/nems/role.epic/hpc-stack/libs/intel-2022.1.2/modulefiles/stack'
hpcstackversion='hpc/1.2.0'
modcomp='hpc-intel/2022.1.2'
modmpi='hpc-impi/2022.1.2'
scotchpath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hpc-stack/scotch-v7.0.3/install'
metispath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hpc-stack/parmetis-4.0.3/install'
modcmake='cmake/3.20.1'
spackstackpath='/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.0/envs/unified-env-noavx512/install/modulefiles/Core'
modcomp='stack-intel/2021.5.0'
modmpi='stack-intel-oneapi-mpi/2021.5.1'
metispath='/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/spack-stack/1.5.0/parmetis-4.0.3/install'
modcmake='cmake/3.23.1'
elif [ $isorion ]
then
batchq='slurm'
basemodcomp='intel/2022.1.2'
basemodmpi='impi/2022.1.2'
hpcstackpath='/work/noaa/epic-ps/role-epic-ps/hpc-stack/libs/intel-2022.1.2/modulefiles/stack'
hpcstackversion='hpc/1.2.0'
modcomp='hpc-intel/2022.1.2'
modmpi='hpc-impi/2022.1.2'
scotchpath='/work2/noaa/marine/mmasarik/waves/opt/hpc-stack/scotch-v7.0.3/install'
metispath='/work2/noaa/marine/mmasarik/waves/opt/hpc-stack/parmetis-4.0.3/install'
modcmake='cmake/3.22.1'
spackstackpath='/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.5.0/envs/unified-env/install/modulefiles/Core'
modcomp='stack-intel/2022.0.2'
modmpi='stack-intel-oneapi-mpi/2021.5.1'
metispath='/work/noaa/marine/Matthew.Masarik/waves/opt/spack-stack/1.5.0/parmetis-4.0.3/install'
modcmake='cmake/3.23.1'
else
batchq=
fi
Expand Down Expand Up @@ -139,29 +137,28 @@ EOF

# Netcdf, Parmetis and SCOTCH modules & variables
echo " module purge" >> matrix.head
echo " module load $modcmake" >> matrix.head
if [ ! -z $basemodcomp ]; then
echo " module load $basemodcomp" >> matrix.head
fi
if [ ! -z $basemodmpi ]; then
echo " module load $basemodmpi" >> matrix.head
fi
echo " module use $hpcstackpath" >> matrix.head
echo " module load $hpcstackversion" >> matrix.head
echo " module use $spackstackpath" >> matrix.head
echo " module load $modcomp" >> matrix.head
echo " module load $modmpi" >> matrix.head
echo " module load $modcmake" >> matrix.head
echo " module load $modpng" >> matrix.head
echo " module load $modzlib" >> matrix.head
echo " module load $modjasper" >> matrix.head
echo " module load $modhdf5" >> matrix.head
echo " module load $modnetcdf" >> matrix.head
echo " module load $modnetcdfc" >> matrix.head
echo " module load $modnetcdff" >> matrix.head
echo " module load $modbacio" >> matrix.head
echo " module load $modg2" >> matrix.head
echo " module load $modw3emc" >> matrix.head
echo " module load $modesmf" >> matrix.head

echo " module load $modscotch" >> matrix.head
echo " export METIS_PATH=${metispath}" >> matrix.head
echo " export SCOTCH_PATH=${scotchpath}" >> matrix.head
echo " export path_build_root=$(dirname $main_dir)/regtests/buildmatrix" >> matrix.head
echo ' [[ -d ${path_build_root} ]] && rm -rf ${path_build_root}' >> matrix.head
echo ' '
Expand Down

0 comments on commit 0fa7e36

Please sign in to comment.