NOAA-EMC / WW3

WAVEWATCH III
Other
265 stars 542 forks source link

Update subroutine W3IOPO to read/write NetCDF files (point output binary -> netcdf) #682

Closed JessicaMeixner-NOAA closed 4 months ago

JessicaMeixner-NOAA commented 2 years ago

Is your feature request related to a problem? Please describe. Update the subroutine w3iopo in model/src/w3iopomd.F90 to read/write netcdf instead of binary files.

Describe the solution you'd like Have point output be netcdf instead of binary from the model forecast.

Describe alternatives you've considered Have point output files be optionally binary or netcdf. This is not impossible but does add a layer of complexity that is not ideal. At one points binary files were preferred due to size and speed, but perhaps those concerns can be overcome or will be outweighed by the benefit of having more readable files. Additionally there was concerns about creating a requirement to have NetCDF and that some users might not have access to this. However, when this was first mentioned was about 5 years ago and NetCDF is a very common library so perhaps that concern is also no longer a reason to not pursue only NetCDF files.

Additional context This perhaps makes the post processing in ww3_ounp partially redundant. This should also help in refactoring ww3_outp.

edwardhartnett commented 1 year ago

@JessicaMeixner-NOAA can I have one of the data files that are read/written by w3iopo()?

edwardhartnett commented 1 year ago

Some detail from Matt on running the tests:

Here's some notes for what we talked about:

The matrix compare link above describes the process I was describing to do the comparison (run develop, run pr-branch, then matrix.comp between the two).

Outline of basic regtest steps

    git clone https://github.com/NOAA-EMC/WW3
    cd WW3
    ./model/bin/ww3_from_ftp.sh                 # gets input data for tests
    cd regtests
    ./bin/matrix_cmake_ncep ../model            # prepare "matrix" scripts
                                                # edit a "matrix??" file.  In the example directory, I did:  matrix05 --> w3_pnt05
    sbatch <edited-matrix-file>
JessicaMeixner-NOAA commented 1 year ago

@JessicaMeixner-NOAA can I have one of the data files that are read/written by w3iopo()?

@edwardhartnett this comment got lost. @MatthewMasarik-NOAA have you already shared this info or do we need to set up 1-2 regtests for Ed for this? (one for per time-snap writing)

MatthewMasarik-NOAA commented 1 year ago

@JessicaMeixner-NOAA, I've shared info with @edwardhartnett for running regtests. I think I will be meeting with him this afternoon for some follow up.

JessicaMeixner-NOAA commented 1 year ago

@MatthewMasarik-NOAA sounds good. It might be helpful to pick a single regression test that could be a test to run instead of running all of the regression tests. Have you shared with @edwardhartnett which program makes the output of w3iopo and which reads it as well?

Please let me know if you need anything additional from me.

edwardhartnett commented 1 year ago

OK, I was able to run (at least one) regression test on my local ubuntu laptop. To do that, follow the steps in the .github/workflows/gnu.yml file to install dependencies with spack and build.

Then follow Matthew's steps above to run the regression test. I had to do:

export LD_LIBRARY_PATH=/home/ed/spack/var/spack/environments/ww3-gnu/.spack-env/view/lib to allow the netcdf fortran shared library to be found.

Then I ran one of the tests and got (I believe) the expected output:

source ./matrix05 
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found
module: command not found

             **********************************************
           ***  WAVEWATCH III matrix of regression tests  ***
             **********************************************

    Tests for single CPU codes                       : y
    Tests for multiple CPU codes (MPI)               : y
    Tests for multiple CPU codes (OMP)               : y
    Tests for threaded multiple CPU codes (MPI/OMPH) : y

      1D pure propagation tests          : y
      2D pure propagation tests          : y
      Growth curves (time)               : y
      Growth curves (fetch)              : y
      Shallow water tests                : y
      Unstructured grid tests            : y
      SMC grid tests                     : y
      Rotated pole tests                 : y
      Hurricane with one moving grid     : y
      Mud/Ice and wave interaction tests : y
      Second harmonic generation tests   : y
      Multi 01 (wet and dry)             : y
      Multi 02 (basic nesting)           : y
      Multi 03 (nesting and overlap)     : y
      Multi 04 (swell on mount/current)  : y
      Multi 05 (hurricane 3 moving grds) : y
      Multi 06 (curv. + reg. grds)       : y
      Multi 07 (unstr. + reg. grds)      : y
      Multi 08 (with ice)                : y
      Multi 09 (SMC multi grid)          : y
      Assim Update of the restart file   : y
      OASIS coupling                     : y
      Calendar type                      : y
      ESMF Coupling                      : n
      The Unified Forecast System        : y
      grib file field output             : y
      Restart Reproducibility            : y
      MPI task Reproducibility           : y
      Thread Reproducibility             : y
      Configurable netCDF generation     : y

 Running now options: run_test -o all -S -T -s ST4_PR2_UQ_MPI -w work_ST4_PR2_UQ_MPI -m grdset_a -f -p mpirun -n 24 ../model mww3_test_05

   Building WW3, exes will be in /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/exe
   Build log is in /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/build.log

                    ==================================   
                  ======> TEST RUN WAVEWATCH III <====== 
                    ==================================   

#############################################################################
#                                                                           #
# mww3_test_05 : Tests for static nesting (propagation only)                #
#                Telescoping nests over hurricane, with continuous moving   #
#                grid, no outer boundaries.                                 #
#                                                                           #
# Model should be compiled with the switches :                              #
#                                                                           #
#   !/FLXn !/LNn !/STn !/NLn !/BT0 !/DB0 !/TR0 !/BS0                        #
#                        Deep water source term only.                       #
#   !/PRn                Selecting one of the propagation schemes.          #
#   !/WNX1 !/WNT1 !/CRX1 !/CRT1      Wind and current interpolation.        #
#   !/O0 !/O1 !/O2 !/O3 !/O4 !/O5 !/O6 !/O7 !/O10                           #
#                        Sdt out output options.                            #
#   !/MGP !/MGG          Moving grid options.                               #
#                                                                           #
# No other optional switches should be used.                                #
#                                                                           #
# Remarks :                                                                 #
#                                                                           #
# - Test case input (default):                                              #
#   * ww3_grid_grd0.inp :                   (Single large high-res grid )   #
#     + Spatial grid: 523 x 523 rectilinear Cartesian grid                  #
#       - dx = 5 km, dy = 5 km                                              #
#       - Xrange = -1305:1305 km, Yrange = -1305:1305 km                    #
#     + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.10    #
#   * ww3_grid_grd1.inp :                                  ( outer grid )   #
#     + Spatial grid: 55 x 55 rectilinear Cartesian grid                    #
#       - dx = 50 km, dy = 50 km                                            #
#       - Xrange = -1350:1350 km, Yrange = -1350:1350 km                    #
#     + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.10    #
#   * ww3_grid_grd2.inp :                                 ( middle grid )   #
#     + Spatial grid: 51 x 51 rectilinear Cartesian grid                    #
#       - dx = 15 km, dy = 15 km                                            #
#       - Xrange = -375:375 km, Yrange = -375:375 km                        #
#     + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.10    #
#     + Circular mask.                                                      #
#   * ww3_grid_grd3.inp :                                  ( inner grid )   #
#     + Spatial grid: 55 x 55 rectilinear Cartesian grid                    #
#       - dx = 5 km, dy = 5 km                                              #
#       - Xrange = -125:125 km, Yrange = -125:125 km                        #
#     + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.10    #
#     + Circular mask.                                                      #
#                                                                           #
#   *  Grid sets available :                                                #
#     + grdset_a : grd1 grd2 grd3                                           #
#     + grdset_b : grd0 (historical only)                                   #
#     + grdset_c : grd1 (historical only)                                   #
#     + grdset_d : grd2 (historical only)                                   #
#     + grdset_e : grd3 (historical only)                                   #
#                                                                           #
#   *  map_m05.gs: GrADS script for grdset_a, requires minor editing for    #
#                  the other grid set options.                              #
#                                                                           #
# - switch options (mostly self-explanatory).                               #
#    + switch_ST1_PR1                                                       #
#    + switch_ST1_PR2_UNO                                                   #
#    + switch_ST1_PR2_UQ                                                    #
#    + switch_ST1_PR3_UNO                                                   #
#    + switch_ST1_PR3_UQ                                                    #
#    + switch_ST1_PR3_UNO_SCRIP                                             #
#    + switch_ST1_PR3_UQ_SCRIP                                              #
#    + switch_ST1_PR3_UNO_SCRIP_T38                                         #
#    + switch_ST1_PR3_UQ_SCRIP_T38                                          #
#    + switch_ST2_PR1                 (default)                             #
#    + switch_ST2_PR2_UNO                                                   #
#    + switch_ST2_PR2_UQ                                                    #
#    + switch_ST2_PR3_UNO                                                   #
#    + switch_ST2_PR3_UQ                                                    #
#    + switch_ST2_PR3_UNO_SCRIP_T38                                         #
#    + switch_ST2_PR3_UQ_SCRIP_T38                                          #
#    + switch_ST3_PR1                                                       #
#    + switch_ST3_PR2_UNO                                                   #
#    + switch_ST3_PR2_UQ                                                    #
#    + switch_ST3_PR3_UNO                                                   #
#    + switch_ST3_PR3_UQ                                                    #
#    + switch_ST4_PR1                                                       #
#    + switch_ST4_PR2_UNO                                                   #
#    + switch_ST4_PR2_UQ                                                    #
#    + switch_ST4_PR3_UNO                                                   #
#    + switch_ST4_PR3_UQ                                                    #
#    + switch_ST6_PR1                                                       #
#    + switch_ST6_PR2_UNO                                                   #
#    + switch_ST6_PR2_UQ                                                    #
#    + switch_ST6_PR3_UNO                                                   #
#    + switch_ST6_PR3_UQ                                                    #
#    + switch_ST1_PR1_MPI                                                   #
#    + switch_ST1_PR2_UNO_MPI                                               #
#    + switch_ST1_PR2_UQ_MPI                                                #
#    + switch_ST1_PR3_UNO_MPI                                               #
#    + switch_ST1_PR3_UQ_MPI                                                #
#    + switch_ST1_PR1_OMP                                                   #
#    + switch_ST1_PR2_UNO_OMP                                               #
#    + switch_ST1_PR2_UQ_OMP                                                #
#    + switch_ST1_PR3_UNO_OMP                                               #
#    + switch_ST1_PR3_UQ_OMP                                                #
#    + switch_ST1_PR3_UNO_MPI_SCRIP                                         #
#    + switch_ST1_PR3_UQ_MPI_SCRIP                                          #
#    + switch_ST2_PR1_MPI                                                   #
#    + switch_ST2_PR2_UNO_MPI                                               #
#    + switch_ST2_PR2_UQ_MPI                                                #
#    + switch_ST2_PR3_UNO_MPI                                               #
#    + switch_ST2_PR3_UQ_MPI                                                #
#    + switch_ST2_PR1_OMP                                                   #
#    + switch_ST2_PR2_UNO_OMP                                               #
#    + switch_ST2_PR2_UQ_OMP                                                #
#    + switch_ST2_PR3_UNO_OMP                                               #
#    + switch_ST2_PR3_UQ_OMP                                                #
#    + switch_ST2_PR3_UNO_MPI_SCRIP                                         #
#    + switch_ST2_PR3_UQ_MPI_SCRIP                                          #
#    + switch_ST2_PR3_UNO_MPI_SCRIPNC                                       #
#    + switch_ST2_PR3_UQ_MPI_SCRIPNC                                        #
#    + switch_ST3_PR1_MPI                                                   #
#    + switch_ST3_PR2_UNO_MPI                                               #
#    + switch_ST3_PR2_UQ_MPI                                                #
#    + switch_ST3_PR3_UNO_MPI                                               #
#    + switch_ST3_PR3_UQ_MPI                                                #
#    + switch_ST3_PR1_OMP                                                   #
#    + switch_ST3_PR2_UNO_OMP                                               #
#    + switch_ST3_PR2_UQ_OMP                                                #
#    + switch_ST3_PR3_UNO_OMP                                               #
#    + switch_ST3_PR3_UQ_OMP                                                #
#    + switch_ST4_PR1_MPI                                                   #
#    + switch_ST4_PR2_UNO_MPI                                               #
#    + switch_ST4_PR2_UQ_MPI                                                #
#    + switch_ST4_PR3_UNO_MPI                                               #
#    + switch_ST4_PR3_UQ_MPI                                                #
#    + switch_ST4_PR1_OMP                                                   #
#    + switch_ST4_PR2_UNO_OMP                                               #
#    + switch_ST4_PR2_UQ_OMP                                                #
#    + switch_ST4_PR3_UNO_OMP                                               #
#    + switch_ST4_PR3_UQ_OMP                                                #
#    + switch_ST6_PR1_MPI                                                   #
#    + switch_ST6_PR2_UNO_MPI                                               #
#    + switch_ST6_PR2_UQ_MPI                                                #
#    + switch_ST6_PR3_UNO_MPI                                               #
#    + switch_ST6_PR3_UQ_MPI                                                #
#    + switch_ST6_PR1_OMP                                                   #
#    + switch_ST6_PR2_UNO_OMP                                               #
#    + switch_ST6_PR2_UQ_OMP                                                #
#    + switch_ST6_PR3_UNO_OMP                                               #
#    + switch_ST6_PR3_UQ_OMP                                                #
#                                                                           #
#  Example run_test commands:                                               #
#  (some details will vary by local system and configuration)               #
#  ./bin/run_test -m grdset_a -n 3 -p mpirun -s ST6_PR3_UQ_MPI -w work_a  \ #
#                                                  ../model mww3_test_05    #
#  ./bin/run_test -m grdset_b -n 3 -p mpirun -s ST6_PR3_UQ_MPI -w work_b  \ #
#                                                  ../model mww3_test_05    #
#                                                                           #
#                                              Hendrik Tolman, Nov 2005     #
#                                                   Last Mod : Dec 2013     #
#                                                                           #
#    Copyright 2009-2013 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.                             #
#                                                                           #
#############################################################################

 Input directory: /home/ed/WW3/regtests/mww3_test_05/input
 Switch file: /home/ed/WW3/regtests/mww3_test_05/input/switch_ST4_PR2_UQ_MPI

+--------------------+
|  Grid preprocessor |
+--------------------+

   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_grid_grd1.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_grid_grd1.out
mv: 'mod_def.ww3' and 'mod_def.grd1' are the same file
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_grid_grd2.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_grid_grd2.out
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_grid_grd3.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_grid_grd3.out
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_grid_input.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_grid_input.out
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_grid_points.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_grid_points.out

+--------------------+
| Initial conditions |
+--------------------+

   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_strt.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_strt_grd1.out
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_strt.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_strt_grd2.out
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_strt.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_strt_grd3.out

+---------------------+
| Prep forcing fields |
+---------------------+

   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_prep_wind.inp for wind
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_prep_wind.out

+--------------------+
|    Main program    |
+--------------------+

   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_multi_grdset_a.inp
   Screen output copied to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_multi.out

                    *** WAVEWATCH III Multi-grid shell ***    
               =================================================

 ========== STARTING MWW3 INITIALIZATION (WMINIT) =============================

  Opening input file ww3_multi.inp (unit number  8)
  Opening output file log.mww3 (unit number  9)

  Comment character : '$'

  Number of grids          :  3
  Input data grids         :  1
  Single point output file : YES/--

  Output server type       :  1
  Single point output proc : YES/--
       Unified point output [points]
          Initializing grids ...

  Input grid information : 
  nr extension  lev.   cur.   wind   ice    tau    rho    data
 ------------------------------------------------------------
   1 input      ---    ---     X     ---    ---    ---    - - -
 ------------------------------------------------------------

  Grid for point output : 
  nr extension  
 ---------------
     points    
 ---------------

  Wave grid information : 
  nr extension  lev.   cur.   wind   ice    tau    rho    data   move1 rnk grp dmp
 ---------------------------------------------------------------------------------
   1 grd1       ---    ---    input  ---    ---    ---    - - -  yes    1   1   -
   2 grd2       ---    ---    input  ---    ---    ---    - - -  yes    2   2   -
   3 grd3       ---    ---    input  ---    ---    ---    - - -  yes    3   3   -
 ----------------------------------------------------------------------------------

  Group information : 
  nr   grids (part of comm.)
 --------------------------------------------------------------------
   1    1 (0.0000-1.0000)
   2    2 (0.0000-1.0000)
   3    3 (0.0000-1.0000)
 --------------------------------------------------------------------

  Time interval : 
 --------------------------------------------------
       Starting time : 1968/06/06 00:00:00 UTC
       Ending time   : 1968/06/06 06:00:00 UTC

  Model settings : 
 --------------------------------------------------
       Masking computation in nesting : YES/--
       Masking output in nesting      : YES/--

  Output requests : (ALL GRIDS) 
 ==================================================

       Type 1 : Fields of mean wave parameters
      -----------------------------------------
            From     : 1968/06/06 00:00:00 UTC
            To       : 1968/06/07 00:00:00 UTC
            Interval :               30:00

            Fields   : Water depth         
                       Current vel.        
                       Wind speed          
                       Wave height         
                       Mean wave period(-1)
                       Peak frequency      
                       Peak direction      
                       Part. wave height   
                       Part. peak period   
                       Part. mean direction
                       Mean square slopes  

       Type 2 : Point output                  
      -----------------------------------------
            From     : 1968/06/06 00:00:00 UTC
            To       : 1968/06/07 00:00:00 UTC
            Interval :               30:00

            Point  1 :   0.000000E+00  0.000000E+00  eye                                     
                   2 :   0.000000E+00  0.500000E+05  mN                                      
                   3 :  -0.350000E+05  0.350000E+05  mNW                                     
                   4 :  -0.500000E+05  0.000000E+00  mW                                      
                   5 :  -0.350000E+05 -0.350000E+05  mSW                                     
                   6 :   0.000000E+00 -0.500000E+05  mS                                      
                   7 :   0.350000E+05 -0.350000E+05  mSE                                     
                   8 :   0.500000E+05  0.000000E+00  mE                                      
                   9 :   0.350000E+05  0.350000E+05  mNE                                     
                  10 :   0.000000E+00  0.100000E+06  aN                                      
                  11 :  -0.700000E+05  0.700000E+05  aNW                                     
                  12 :  -0.100000E+06  0.000000E+00  aW                                      
                  13 :  -0.700000E+05 -0.700000E+05  aSW                                     
                  14 :   0.000000E+00 -0.100000E+06  aS                                      
                  15 :   0.700000E+05 -0.700000E+05  aSE                                     
                  16 :   0.100000E+06  0.000000E+00  aE                                      
                  17 :   0.700000E+05  0.700000E+05  aNE                                     
                  18 :   0.000000E+00  0.210000E+06  bN                                      
                  19 :  -0.150000E+06  0.150000E+06  bNW                                     
                  20 :  -0.210000E+06  0.000000E+00  bW                                      
                  21 :  -0.150000E+06 -0.150000E+06  bSW                                     
                  22 :   0.000000E+00 -0.210000E+06  bS                                      
                  23 :   0.150000E+06 -0.150000E+06  bSE                                     
                  24 :   0.210000E+06  0.000000E+00  bE                                      
                  25 :   0.150000E+06  0.150000E+06  bNE                                     
                  26 :   0.000000E+00  0.800000E+06  cN                                      
                  27 :  -0.550000E+06  0.550000E+06  cNW                                     
                  28 :  -0.800000E+06  0.000000E+00  cW                                      
                  29 :  -0.550000E+06 -0.550000E+06  cSW                                     
                  30 :   0.000000E+00 -0.800000E+06  cS                                      
                  31 :   0.550000E+06 -0.550000E+06  cSE                                     
                  32 :   0.800000E+06  0.000000E+00  cE                                      
                  33 :   0.550000E+06  0.550000E+06  cNE                                     

  Grid movement data (!/MGP, !/MGW): 
 --------------------------------------------------
       Continuous grid movement data
            1  MOV
               1   19680606 000000    5.00   90.00

  Assigning resources : 
 --------------------------------------------------
       No (other) dedicated output processes.

       grid           comp.      grd    pnt    trk    rst    bpt    prt
      -------------------------------------------------------------------
       grd1        00001-00024  00023  00022  -----  -----  -----  -----
       grd2        00001-00024  00023  00022  -----  -----  -----  -----
       grd3        00001-00024  00023  00022  -----  -----  -----  -----
      -------------------------------------------------------------------
         Unified point output at 00022

  Initializations :
 --------------------------------------------------
       Model number  1 [grd1]
          Initializing wave model ...
          Initializing model input ...
            water levels : file not needed
            currents     : file not needed
            winds        : file not needed
            ice fields   : file not needed
            momentum     : file not needed
            air density  : file not needed
       Model number  2 [grd2]
          Initializing wave model ...
          Initializing model input ...
            water levels : file not needed
            currents     : file not needed
            winds        : file not needed
            ice fields   : file not needed
            momentum     : file not needed
            air density  : file not needed
       Model number  3 [grd3]
          Initializing wave model ...
          Initializing model input ...
            water levels : file not needed
            currents     : file not needed
            winds        : file not needed
            ice fields   : file not needed
            momentum     : file not needed
            air density  : file not needed
       Input data grid  1 [input]
          Initializing grids ...
            water levels : file not needed
            currents     : file not needed
            winds        : file OK
            ice fields   : file not needed
            momentum     : file not needed
            air density  : file not needed

  Computing relation to higher ranked grids

  Generating map with distances to boundary.
Starting MAPBDI 1st loop.
Starting MAPBDI 2nd loop.
    bnd. point    25 out of    51
    bnd. point    50 out of    51
Finished MAPBDI 2nd loop.
  Finished generating map with distances to boundary.

  Generating map with distances to boundary.
Starting MAPBDI 1st loop.
Starting MAPBDI 2nd loop.
    bnd. point    25 out of    51
    bnd. point    50 out of    51
Finished MAPBDI 2nd loop.
  Finished generating map with distances to boundary.

  Finished computing relation to higher ranked grids

  Additional group information

  Lower rank grid dependence : 
  nr   grids (part of comm.)
 --------------------------------------------------------------------
   1   Data from file
   2    1
   3    2
 --------------------------------------------------------------------

  No same rank grid dependencies

  Higher rank grid dependence : 
  nr   grids (part of comm.)
 --------------------------------------------------------------------
   1    2
   2    3
   3   No dependencies
 --------------------------------------------------------------------

  Running the model :
 --------------------------------------------------

 ========== END OF MWW3 INITIALIZATION (WMINIT) ===============================

 ========== STARTING WAVE MODEL (WMWAVE) ======================================

  MWW3 calculating for 1968/06/06 00:00:00 UTC at 10:38:23  status [ 0- 0]

  Updating input for grid  1 at 1968/06/06 00:00:00 UTC
     Updating winds        
        First updating input        
     Updating grid speed   
        Past last grid speed   

 *** WAVEWATCH III WARNING IN W3IOBC : 
     INPUT FILE WITH BOUNDARY CONDITIONS NOT FOUND
     BOUNDARY CONDITIONS WILL NOT BE UPDATED     1

  Updating input for grid  2 at 1968/06/06 00:00:00 UTC
     Updating winds        
     Updating grid speed   
        Past last grid speed   

  Updating input for grid  3 at 1968/06/06 00:00:00 UTC
     Updating winds        
     Updating grid speed   
        Past last grid speed   

  MWW3 calculating for 1968/06/06 00:10:00 UTC at 10:38:24  status [ 1- 5]
  MWW3 calculating for 1968/06/06 00:20:00 UTC at 10:38:40  status [ 1- 5]
  MWW3 calculating for 1968/06/06 00:30:00 UTC at 10:39:01  status [ 1- 5]
  MWW3 calculating for 1968/06/06 00:40:00 UTC at 10:39:16  status [ 1- 5]
  MWW3 calculating for 1968/06/06 00:50:00 UTC at 10:39:28  status [ 1- 5]
  MWW3 calculating for 1968/06/06 01:00:00 UTC at 10:39:39  status [ 1- 5]
  MWW3 calculating for 1968/06/06 01:10:00 UTC at 10:39:49  status [ 1- 5]
  MWW3 calculating for 1968/06/06 01:20:00 UTC at 10:39:58  status [ 1- 5]
  MWW3 calculating for 1968/06/06 01:30:00 UTC at 10:40:07  status [ 1- 5]
  MWW3 calculating for 1968/06/06 01:40:00 UTC at 10:40:16  status [ 1- 5]
  MWW3 calculating for 1968/06/06 01:50:00 UTC at 10:40:23  status [ 1- 5]
  MWW3 calculating for 1968/06/06 02:00:00 UTC at 10:40:30  status [ 1- 5]
  MWW3 calculating for 1968/06/06 02:10:00 UTC at 10:40:36  status [ 1- 5]
  MWW3 calculating for 1968/06/06 02:20:00 UTC at 10:40:42  status [ 1- 5]
  MWW3 calculating for 1968/06/06 02:30:00 UTC at 10:40:47  status [ 1- 5]
  MWW3 calculating for 1968/06/06 02:40:00 UTC at 10:40:52  status [ 1- 5]
  MWW3 calculating for 1968/06/06 02:50:00 UTC at 10:40:57  status [ 1- 5]
  MWW3 calculating for 1968/06/06 03:00:00 UTC at 10:41:01  status [ 1- 5]
  MWW3 calculating for 1968/06/06 03:10:00 UTC at 10:41:05  status [ 1- 5]
  MWW3 calculating for 1968/06/06 03:20:00 UTC at 10:41:09  status [ 1- 5]
  MWW3 calculating for 1968/06/06 03:30:00 UTC at 10:41:12  status [ 1- 5]
  MWW3 calculating for 1968/06/06 03:40:00 UTC at 10:41:16  status [ 1- 5]
  MWW3 calculating for 1968/06/06 03:50:00 UTC at 10:41:20  status [ 1- 5]
  MWW3 calculating for 1968/06/06 04:00:00 UTC at 10:41:23  status [ 1- 5]
  MWW3 calculating for 1968/06/06 04:10:00 UTC at 10:41:26  status [ 1- 5]
  MWW3 calculating for 1968/06/06 04:20:00 UTC at 10:41:30  status [ 1- 5]
  MWW3 calculating for 1968/06/06 04:30:00 UTC at 10:41:33  status [ 1- 5]
  MWW3 calculating for 1968/06/06 04:40:00 UTC at 10:41:36  status [ 1- 5]
  MWW3 calculating for 1968/06/06 04:50:00 UTC at 10:41:39  status [ 1- 5]
  MWW3 calculating for 1968/06/06 05:00:00 UTC at 10:41:42  status [ 1- 5]
  MWW3 calculating for 1968/06/06 05:10:00 UTC at 10:41:45  status [ 1- 5]
  MWW3 calculating for 1968/06/06 05:20:00 UTC at 10:41:48  status [ 1- 5]
  MWW3 calculating for 1968/06/06 05:30:00 UTC at 10:41:51  status [ 1- 5]
  MWW3 calculating for 1968/06/06 05:40:00 UTC at 10:41:54  status [ 1- 5]
  MWW3 calculating for 1968/06/06 05:50:00 UTC at 10:41:57  status [ 1- 5]
  MWW3 calculating for 1968/06/06 06:00:00 UTC at 10:42:00  status [ 1- 5]
  MWW3 reached the end of the computation loop at 10:42:03

 ========== END OF WAVE MODEL (WMWAVE) ========================================

 ========== STARTING MWW3 FINALIZATION (WMFINL) ===============================

  Initialization time :      4.41 s
  Elapsed time        :    223.91 s

 ========== END OF MWW3 INITIALIZATION (WMFINL) ===============================

  End of program 
 ========================================
          WAVEWATCH III Multi-grid shell 

[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects
[WARNING] yaksa: 6 leaked handle pool objects

+--------------------+
|   Gridded output   |
+--------------------+

   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_outf.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_outf_grd1.out
   ASCII output files moved to ww3_outf_grd1
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_outf.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_outf_grd2.out
   ASCII output files moved to ww3_outf_grd2
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_outf.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_outf_grd3.out
   ASCII output files moved to ww3_outf_grd3

+--------------------+
| NC Gridded output  |
+--------------------+

   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_ounf.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_ounf_grd1.out
   NetCDF output files moved to ww3_ounf_grd1
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_ounf.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_ounf_grd2.out
   NetCDF output files moved to ww3_ounf_grd2
   Processing /home/ed/WW3/regtests/mww3_test_05/input/ww3_ounf.inp
   Screen output routed to /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/ww3_ounf_grd3.out
   NetCDF output files moved to ww3_ounf_grd3

Files in /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI :

total 146828
-rw-rw-r-- 1 ed ed     9203 Oct 30 10:38 build.log
drwxrwxr-x 2 ed ed     4096 Oct 30 10:13 exe
-rw-rw-r-- 1 ed ed       32 Oct 30 10:42 finished
-rw-rw-r-- 1 ed ed     5590 Oct 30 10:42 log.grd1
-rw-rw-r-- 1 ed ed     5590 Oct 30 10:42 log.grd2
-rw-rw-r-- 1 ed ed    11638 Oct 30 10:42 log.grd3
-rw-rw-r-- 1 ed ed    39566 Oct 30 10:42 log.mww3
-rw-rw-r-- 1 ed ed 26932349 Oct 30 10:38 mod_def.grd1
lrwxrwxrwx 1 ed ed       12 Oct 30 10:34 mod_def.grd2 -> mod_def.grd1
-rw-rw-r-- 1 ed ed 26932349 Oct 30 10:38 mod_def.grd3
-rw-rw-r-- 1 ed ed 36642637 Oct 30 10:38 mod_def.input
-rw-rw-r-- 1 ed ed 26956909 Oct 30 10:38 mod_def.points
-rw-rw-r-- 1 ed ed  3243450 Oct 30 10:42 out_grd.grd1
-rw-rw-r-- 1 ed ed  3243450 Oct 30 10:42 out_grd.grd2
-rw-rw-r-- 1 ed ed  3243450 Oct 30 10:42 out_grd.grd3
-rw-rw-r-- 1 ed ed  1061062 Oct 30 10:42 out_pnt.points
-rw-rw-r-- 1 ed ed  4932000 Oct 30 10:38 restart.grd1
-rw-rw-r-- 1 ed ed  4932000 Oct 30 10:38 restart.grd2
-rw-rw-r-- 1 ed ed  4932000 Oct 30 10:38 restart.grd3
-rw-rw-r-- 1 ed ed  4222713 Oct 30 10:14 ST4TABUHF2.bin
-rw-rw-r-- 1 ed ed     1404 Oct 30 10:42 time_count.txt
-rw-rw-r-- 1 ed ed  2188312 Oct 30 10:38 wind.input
-rw-rw-r-- 1 ed ed    16412 Oct 30 10:38 ww3_grid_grd1.out
-rw-rw-r-- 1 ed ed    23162 Oct 30 10:38 ww3_grid_grd2.out
-rw-rw-r-- 1 ed ed    23162 Oct 30 10:38 ww3_grid_grd3.out
-rw-rw-r-- 1 ed ed   568256 Oct 30 10:38 ww3_grid_input.out
-rw-rw-r-- 1 ed ed    16412 Oct 30 10:38 ww3_grid_points.out
-rw-rw-r-- 1 ed ed    13773 Oct 30 10:42 ww3_multi.out
drwxrwxr-x 2 ed ed     4096 Oct 30 10:42 ww3_ounf_grd1
-rw-rw-r-- 1 ed ed     2153 Oct 30 10:42 ww3_ounf_grd1.out
drwxrwxr-x 2 ed ed     4096 Oct 30 10:42 ww3_ounf_grd2
-rw-rw-r-- 1 ed ed     2153 Oct 30 10:42 ww3_ounf_grd2.out
drwxrwxr-x 2 ed ed     4096 Oct 30 10:42 ww3_ounf_grd3
-rw-rw-r-- 1 ed ed     2153 Oct 30 10:42 ww3_ounf_grd3.out
drwxrwxr-x 2 ed ed     4096 Oct 30 10:42 ww3_outf_grd1
-rw-rw-r-- 1 ed ed     1625 Oct 30 10:42 ww3_outf_grd1.out
drwxrwxr-x 2 ed ed     4096 Oct 30 10:42 ww3_outf_grd2
-rw-rw-r-- 1 ed ed     1625 Oct 30 10:42 ww3_outf_grd2.out
drwxrwxr-x 2 ed ed     4096 Oct 30 10:42 ww3_outf_grd3
-rw-rw-r-- 1 ed ed     1625 Oct 30 10:42 ww3_outf_grd3.out
-rw-rw-r-- 1 ed ed     1263 Oct 30 10:38 ww3_prep_wind.out
-rw-rw-r-- 1 ed ed     5714 Oct 30 10:38 ww3_strt_grd1.out
-rw-rw-r-- 1 ed ed     5714 Oct 30 10:38 ww3_strt_grd2.out
-rw-rw-r-- 1 ed ed     5714 Oct 30 10:38 ww3_strt_grd3.out

                    ==================================   
                  ======>  END OF WAVEWATCH III  <====== 
                    ==================================   

     **************************************************************
     *  end of WAVEWATCH III matrix05 of regression tests  *
     **************************************************************

ed@Pooh-Bah:~/WW3/regtests$ 

I would be helpful to know if this particular test uses w3iopo(). Is there any easy way to tell from the output? Or do all tests use w3iopo()?

If someone could point me to a reasonably small output file, that would be very helpful. Did my regtest produce one? If so, where would it be?

JessicaMeixner-NOAA commented 1 year ago

@edwardhartnett this is great that you were able to run a regression tests. /home/ed/WW3/regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/out_pnt.points is the output of w3iopo . This test isn't running any point output which would then read this file.

While we'll eventually want/need all regtests to run, perhaps it'll be easier to choose a very small simple regression test, that we know has point output and is fairly small. @MatthewMasarik-NOAA any ideas which one would be a great candidate for this, otherwise I can look in about an hour.

MatthewMasarik-NOAA commented 1 year ago

Yes, I was being loose when I said we went over regression testing. We did pick just one test as a small, single test case. The output Ed posted is from that test case, and it has point output, too. Was there something else you had in mind for the test case?

JessicaMeixner-NOAA commented 1 year ago

I only saw gridded post-procssing output, not point post processing in @edwardhartnett log. I might chose a single versus multi-grid test to start with personally, but this test certainly will work. I do think we will eventually need to make sure we get some sort of point post-processing added here.

JessicaMeixner-NOAA commented 1 year ago

So we have the full set of regression tests, but personally I think starting with something simpler (ie ww3_shel versus ww3_multi) might be a good idea, plus this test has point output (ie it will also read the output from w3iopo), and this test is:

./bin/run_cmake_test -b slurm -o all -S -T -s PR1 -w work_PR1 ../model ww3_tp1.4 Remove the -b if you do not wish to run on hera/orion and are on your local machine.

For multi-grid, we have 2 options:

Another option which is admittedly not well documented is to have each point output write it's own time-snap file. You then have to process each time snap differently as it's own out_pnt.ww3 file renamed from the time-stamped file. This is currently done in the global-wrokflow but not in one of the regression tests here. This is the first step toward improving that process.

Please let me know if you have any additional questions or things I can help with.

MatthewMasarik-NOAA commented 1 year ago

Thanks for this very helpful info, @JessicaMeixner-NOAA!

edwardhartnett commented 1 year ago

OK, here's a simple question, when I run run_cmake_test, what is the actual binary file that is executed?

In other words, how do I use a debugger on the regression test code?

edwardhartnett commented 1 year ago

OK, so I was able to run Jessica's suggested test:

ed@Pooh-Bah:~/WW3/regtests$ ./bin/run_cmake_test -o all -S -T -s PR1 -w work_PR1 ../model ww3_tp1.4

 Running now options: run_test -o all -S -T -s PR1 -w work_PR1 ../model ww3_tp1.4

   Building WW3, exes will be in /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/exe
   Build log is in /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/build.log

                    ==================================   
                  ======> TEST RUN WAVEWATCH III <====== 
                    ==================================   

#############################################################################
#                                                                           #
# ww3_tp1.4 Test script for WW-III, one-dimensional propagation.            #
#           spectral refraction (X).                                        #
#                                                                           #
# Model should be compiled with the switches :                              #
#                                                                           #
#   !/LN0 !/ST0 !/NL0 !/BT0 !/DB0 !/TR0 !/BS0                               #
#                        Select the 'no source terms' option.               #
#   !/PRn                Selecting one of the propagation schemes.          #
#                         1: First order.                                   #
#                         2: Representative for all UQ schemes              #
#                         3: Switch smoothing off to reproduce 2.           #
#   !/WNX1 !/WNT1 !/CRX1 !/CRT1      Wind and current interpolation.        #
#   !/O0 !/O1 !/O2 !/O3 !/O4 !/O5 !/O6 !/O7   Sdt out output options.       #
#                                                                           #
# Remarks :                                                                 #
#                                                                           #
# - Several initial conditions and shoaling to left or right are available  #
#   in the test case. Select by commenting/uncommenting lines in            #
#   ww3_grid.inp and ww3_strt.inp. NOT YET CONVERTED TO regtests            #
# - Note that the refraction time step is chosen as half the spatial        #
#   time step to avoid slight wiggling due to the otherwise alternating     #
#   order of the spatial and spectral propagation steps.                    #
# - Test case input (default):                                              #
#   * ww3_grid.inp : (default)                                              #
#     + Spatial grid: 13 x 3 rectilinear Cartesian grid                     #
#       - dx = 5 km, dy = 5 km                                              #
#       - Xrange = -5:55 km, Yrange = -5:5 km                               #
#     + Spectral grid: ntheta = 24, nf =  3, f1 = 0.08,    fgamma = 1.25    #
#   * switch options :                                                      #
#     + switch_PR1     : First order scheme                                 #
#     + switch_PR2_UNO : UNO scheme with diffusion (off)                    #
#     + switch_PR2_UQ  : UQ scheme with diffusion (off)                     #
#     + switch_PR3_UNO : UNO scheme with averaging (off)                    #
#     + switch_PR3_UQ  : UQ scheme with averaging (off) (default)           #
#                                                                           #
#  Example run_test commands:                                               #
#  (some details will vary by local system and configuration)               #
#  ./bin/run_test -s PR1    -w work_PR1 ../model ww3_tp1.4                  #
#  ./bin/run_test -s PR2_UQ -w work_PR2 ../model ww3_tp1.4                  #
#  ./bin/run_test -s PR3_UQ -w work_PR3 ../model ww3_tp1.4                  #
#                                                                           #
#                                              Hendrik Tolman, Jun 2002     #
#                                                   Last Mod : Aug 2013     #
#                                                                           #
#    Copyright 2009-2013 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.                             #
#                                                                           #
#############################################################################

 Input directory: /home/ed/WW3/regtests/ww3_tp1.4/input
 Switch file: /home/ed/WW3/regtests/ww3_tp1.4/input/switch_PR1

+--------------------+
|  Grid preprocessor |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_grid.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_grid.out

+--------------------+
| Initial conditions |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_strt.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_strt.out

+--------------------+
|    Main program    |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_shel.inp
   Screen output copied to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_shel.out

                     *** WAVEWATCH III Program shell ***      
               ===============================================

  Comment character is '$'

  Input fields : 
 --------------------------------------------------
       water levels   ---/NO                      
       currents       ---/NO                      
       winds          ---/NO                      
       ice fields     ---/NO                      
       momentum       ---/NO                      
       air density    ---/NO                      
       mean param.    ---/NO                      
       1D spectra     ---/NO                      
       2D spectra     ---/NO                      

            Fields   : Wave height         
                       Mean wave period(+1)
                       Mean wave dir. a1b1 
            Point  1 :      0.0E3     0.0E3  Point1                                  
                   2 :      5.0E3     0.0E3  Point2                                  
                   3 :     10.0E3     0.0E3  Point3                                  
                   4 :     15.0E3     0.0E3  Point4                                  
                   5 :     20.0E3     0.0E3  Point5                                  
                   6 :     25.0E3     0.0E3  Point6                                  
                   7 :     30.0E3     0.0E3  Point7                                  
                   8 :     35.0E3     0.0E3  Point8                                  
                   9 :     40.0E3     0.0E3  Point9                                  
                  10 :     45.0E3     0.0E3  Point10                                 
                  11 :     50.0E3     0.0E3  Point11                                 
            Fields   : no fields defined

  Initializations :
 --------------------------------------------------

  Time interval : 
 --------------------------------------------------
       Starting time : 1968/06/06 00:00:00 UTC
       Ending time   : 1968/06/06 12:00:00 UTC

  Output requests : 
 --------------------------------------------------
       No dedicated output process, any file system.

       Type 1 : Fields of mean wave parameters
      -----------------------------------------
            From     : 1968/06/06 00:00:00 UTC
            To       : 1968/06/06 12:00:00 UTC
            Interval :            00:15:00

       Type 2 : Point output                  
      -----------------------------------------
            From     : 1968/06/06 00:00:00 UTC
            To       : 1968/06/06 12:00:00 UTC
            Interval :            00:15:00

            output dates out of run dates : Restart files second request deactivated
       Wave model ...

  Running model without input fields
 --------------------------------------------------

  WAVEWATCH III calculating for 1968/06/06 00:00:00 UTC at 14:10:42

 *** WAVEWATCH III WARNING IN W3IOBC : 
     INPUT FILE WITH BOUNDARY CONDITIONS NOT FOUND
     BOUNDARY CONDITIONS WILL NOT BE UPDATED     1

  WAVEWATCH III calculating for 1968/06/06 00:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 00:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 01:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 02:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 03:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 04:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 05:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 06:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 07:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 08:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 09:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 10:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:00:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:05:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:10:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:15:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:20:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:25:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:30:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:35:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:40:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:45:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:50:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 11:55:00 UTC at 14:10:42
  WAVEWATCH III calculating for 1968/06/06 12:00:00 UTC at 14:10:42
  WAVEWATCH III reached the end of a computation loop at 14:10:42

  Initialization time :      0.00 s
  Elapsed time        :      0.02 s

  End of program 
 ====================================
         WAVEWATCH III Program shell 

+--------------------+
|   Gridded output   |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_outf.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_outf.out

+--------------------+
| NC Gridded output  |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_ounf.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_ounf.out

+--------------------+
|    Point output    |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_outp_spec.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_outp_spec.out
   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_outp_tab50.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_outp_tab50.out
   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_outp_tab51.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_outp_tab51.out

+--------------------+
| NC Point output    |
+--------------------+

   Processing /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_ounp.inp
   Screen output routed to /home/ed/WW3/regtests/ww3_tp1.4/work_PR1/ww3_ounp.out

Files in /home/ed/WW3/regtests/ww3_tp1.4/work_PR1 :

total 452
-rw-rw-r-- 1 ed ed   9051 Oct 30 14:10 build.log
drwxrwxr-x 2 ed ed   4096 Oct 30 14:10 exe
-rw-rw-r-- 1 ed ed     32 Oct 30 14:10 finished
-rw-rw-r-- 1 ed ed   6589 Oct 30 14:10 log.ww3
-rw-rw-r-- 1 ed ed   6321 Oct 30 14:10 mod_def.ww3
-rw-rw-r-- 1 ed ed  55770 Oct 30 14:10 out_grd.ww3
-rw-rw-r-- 1 ed ed 193804 Oct 30 14:10 out_pnt.ww3
-rw-rw-r-- 1 ed ed   3744 Oct 30 14:10 restart.ww3
-rw-rw-r-- 1 ed ed   3476 Oct 30 14:10 tab50.ww3
-rw-rw-r-- 1 ed ed   4109 Oct 30 14:10 tab51.ww3
-rw-rw-r-- 1 ed ed    579 Oct 30 14:10 time_count.txt
-rw-rw-r-- 1 ed ed   9148 Oct 30 14:10 ww3.196806.nc
-rw-rw-r-- 1 ed ed  52348 Oct 30 14:10 ww3.196806_spec.nc
-rw-rw-r-- 1 ed ed   7270 Oct 30 14:10 ww3_grid.out
-rw-rw-r-- 1 ed ed   5141 Oct 30 14:10 ww3_ounf.out
-rw-rw-r-- 1 ed ed   3588 Oct 30 14:10 ww3_ounp.out
-rw-rw-r-- 1 ed ed  17559 Oct 30 14:10 ww3_outf.out
-rw-rw-r-- 1 ed ed  15276 Oct 30 14:10 ww3_outp_spec.out
-rw-rw-r-- 1 ed ed   2316 Oct 30 14:10 ww3_outp_tab50.out
-rw-rw-r-- 1 ed ed   1646 Oct 30 14:10 ww3_outp_tab51.out
-rw-rw-r-- 1 ed ed  13079 Oct 30 14:10 ww3_shel.out
-rw-rw-r-- 1 ed ed   2331 Oct 30 14:10 ww3_strt.out

                    ==================================   
                  ======>  END OF WAVEWATCH III  <====== 
                    ==================================   

ed@Pooh-Bah:~/WW3/regtests$ 
edwardhartnett commented 1 year ago

In the regtest output is says:

# Model should be compiled with the switches :                              #
#                                                                           #
#   !/LN0 !/ST0 !/NL0 !/BT0 !/DB0 !/TR0 !/BS0                               #
#                        Select the 'no source terms' option.               #
#   !/PRn                Selecting one of the propagation schemes.          #
#                         1: First order.                                   #
#                         2: Representative for all UQ schemes              #
#                         3: Switch smoothing off to reproduce 2.           #
#   !/WNX1 !/WNT1 !/CRX1 !/CRT1      Wind and current interpolation.        #
#   !/O0 !/O1 !/O2 !/O3 !/O4 !/O5 !/O6 !/O7   Sdt out output options.       #

I didn't compile the model with these switches. Is that a problem?

JessicaMeixner-NOAA commented 1 year ago

OK, here's a simple question, when I run run_cmake_test, what is the actual binary file that is executed?

Several executables are executed in the run_cmake_test script for the various parts of the code. If it'd be helpful we can create a canned case to run just the executables needed to run to write and then read the binary out_pnt.ww3 files

In other words, how do I use a debugger on the regression test code?

There are several ways to do this. I usually hard-code that cmake is set to debug instead of release. We can set up a meeting to walk you through this if we do not set-up the more limited canned case for you.

If you were writing code to read this file, what global data structures would have to be set up before w3iopo() is called to read the file?

There are likely several data structures that are input to the routine as well as those that are in module files.

In the regtest output is says:

# Model should be compiled with the switches :                              #
#                                                                           #
#   !/LN0 !/ST0 !/NL0 !/BT0 !/DB0 !/TR0 !/BS0                               #
#                        Select the 'no source terms' option.               #
#   !/PRn                Selecting one of the propagation schemes.          #
#                         1: First order.                                   #
#                         2: Representative for all UQ schemes              #
#                         3: Switch smoothing off to reproduce 2.           #
#   !/WNX1 !/WNT1 !/CRX1 !/CRT1      Wind and current interpolation.        #
#   !/O0 !/O1 !/O2 !/O3 !/O4 !/O5 !/O6 !/O7   Sdt out output options.       #

I didn't compile the model with these switches. Is that a problem?

The run_cmake_test compiles the code. For what you are doing the switches are not as important so shouldn't matter.

Sounds like a meeting would be helpful to discuss these and more questions.

edwardhartnett commented 1 year ago

@JessicaMeixner-NOAA I am available to meet at any time you think it would be helpful. Meanwhile, I will try and figure out where the existing code is that reads/writes these data files...

MatthewMasarik-NOAA commented 1 year ago

@edwardhartnett and I just tried to meet, unfortunately my GFE mic was acting up, so we had to cancel. We were possiibly going to meet tomorrow now instead. Maybe the 3 of use could meet

JessicaMeixner-NOAA commented 1 year ago

Happy to join the meeting

edwardhartnett commented 1 year ago

OK, great. Meanwhile any specific information about what is being run with run_cmake_test that is doing the I/O would be most helpful, I am running it now to try and figure out where to start the debugger, but some specific info would be helpful. Is there any documentation of what is happening?

edwardhartnett commented 1 year ago

When I try and run the tests again I get:

bash ./bin/run_cmake_test -o all -S -T -s PR1 -w work_PR1 ../model ww3_tp1.4

 Running now options: run_test -o all -S -T -s PR1 -w work_PR1 ../model ww3_tp1.4

 Test already finished, skipping ...

Is there a way to reset them and run them again?

MatthewMasarik-NOAA commented 1 year ago

Sure, i can give some info on run_cmake_test

MatthewMasarik-NOAA commented 1 year ago

The program see's the work_* directory and skips it. If you remove ww3_tp1.4/work_PR1 directory, then you can re-run it

MatthewMasarik-NOAA commented 1 year ago

OK, great. Meanwhile any specific information about what is being run with run_cmake_test that is doing the I/O would be most helpful, I am running it now to try and figure out where to start the debugger, but some specific info would be helpful. Is there any documentation of what is happening?

run_cmake_test is doing a complete simulation as in: build all (pre/run/post) executables, then run preprocessing programs, the actual run, post processing. It is all streamlined into one call. To do just the run (which is where w3iopo() is called) we can set you up with a canned case.

edwardhartnett commented 1 year ago

Well by all means, set me up with anything you think is helpful. I don't know what you mean by canned case. ;-)

I will continue to dig into the code.

edwardhartnett commented 1 year ago

OK from a grep I see that some of the read code can be found in model/src/gx_outp.F90. There is some I/O set up going on here. Presumably this code is called by the regtest somewhere.

Here's some I/O setup from gx_outp.F90:

  ! 1.  IO set-up.
  !
  CALL W3NMOD ( 1, 6, 6 )
  CALL W3SETG ( 1, 6, 6 )
  CALL W3NDAT (    6, 6 )
  CALL W3SETW ( 1, 6, 6 )
#ifdef W3_NL1
  CALL W3NAUX (    6, 6 )
  CALL W3SETA ( 1, 6, 6 )
#endif
  CALL W3NOUT (    6, 6 )
  CALL W3SETO ( 1, 6, 6 )

Looks like these have to be called before w3iopo()...

MatthewMasarik-NOAA commented 1 year ago

I just sent some info to the email thread. gx_outp.F90 does call w3iopo(), but that is the standalone GrADS point output routine, and is not the call to w3iopo we are interested in. We are interested in the w3wave call.

edwardhartnett commented 1 year ago

From Matt's email, answers to question about what binary is calling the I/O subroutine w3iopo().

The program that is called as a binary is ww3_shel, from ww3_shel.F90. This is the driver for w3wavemd.F90, which is the main WW3 routine. w3wave calls w3iopo(), as does ww3_ounp, and ww3_outp. ww3_ounp is the standalone netcdf point post-processing program, and I don't think it is the call to w3iopo() that we are interested in. I believe we are interested in the w3wave call to w3iopo.

MatthewMasarik-NOAA commented 1 year ago

Ps,

Here's some I/O setup from gx_outp.F90:

  ! 1.  IO set-up.
  !
  CALL W3NMOD ( 1, 6, 6 )
  CALL W3SETG ( 1, 6, 6 )
  CALL W3NDAT (    6, 6 )
  CALL W3SETW ( 1, 6, 6 )
#ifdef W3_NL1
  CALL W3NAUX (    6, 6 )
  CALL W3SETA ( 1, 6, 6 )
#endif
  CALL W3NOUT (    6, 6 )
  CALL W3SETO ( 1, 6, 6 )

The analogous calls in w3wave are here: https://github.com/NOAA-EMC/WW3/blob/8eb35962c396267b56d569ef32a27be0d5bb1657/model/src/w3wavemd.F90#L615-L619

and the call to w3iopo https://github.com/NOAA-EMC/WW3/blob/8eb35962c396267b56d569ef32a27be0d5bb1657/model/src/w3wavemd.F90#L2605

edwardhartnett commented 1 year ago

When I try to run ww3_shel from the command line I get an error. There must be some setup I need to do:

./ww3_shel 

                     *** WAVEWATCH III Program shell ***      
               ===============================================

At line 1195 of file /home/ed/WW3/model/src/ww3_shel.F90 (unit = 10, file = 'fort.10')
Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x7f50b6423960 in ???
#1  0x7f50b64244d9 in ???
#2  0x7f50b642510f in ???
#3  0x7f50b667817b in ???
#4  0x7f50b6678752 in ???
#5  0x7f50b6674f1b in ???
#6  0x7f50b6679e3c in ???
#7  0x7f50b667ae55 in ???
#8  0x55d8a29faf6c in w3shel
    at /home/ed/WW3/model/src/ww3_shel.F90:1195
#9  0x55d8a2a1a6e6 in main
    at /home/ed/WW3/model/src/ww3_shel.F90:253
ed@Pooh-Bah:~/WW3/b/bin$ 
MatthewMasarik-NOAA commented 1 year ago

ww3_shel takes a configuration file (ww3_shel.inp), additionally you would need to have the other supporting data (grid, forcing) also, for ww3_shel to run. This is what a regression test does for you, or alternatively what we could provide in a canned case.

edwardhartnett commented 1 year ago

OK, so it seems to set symbolic links to those files, let me give that a try...

ln -s /home/ed/WW3/regtests/ww3_tp1.4/input/ww3_shel.inp ww3_shel.inp
ed@Pooh-Bah:~/WW3/b/bin$ ./ww3_shel 

                     *** WAVEWATCH III Program shell ***      
               ===============================================

  Comment character is '$'

  Input fields : 
 --------------------------------------------------
       water levels   ---/NO                      
       currents       ---/NO                      
       winds          ---/NO                      
       ice fields     ---/NO                      
       momentum       ---/NO                      
       air density    ---/NO                      
       mean param.    ---/NO                      
       1D spectra     ---/NO                      
       2D spectra     ---/NO                      

 *** WAVEWATCH III ERROR IN W3IOGR : 
     ERROR IN OPENING mod_def.ww3 FILE
     IOSTAT =    2

EXTCDE MPI_ABORT, IEXIT=    50

Abort(50) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 50) - process 0
ed@Pooh-Bah:~/WW3/b/bin$ 

I can find a file to link to for the .inp, but what files are involved with the supporting grid and forcing data. I can't see where run_cmake_test does a link to them. What are the filenames?

edwardhartnett commented 1 year ago

OK, @MatthewMasarik-NOAA and I had a long chat yesterday and I learned a lot.

A switch file is always required to build, and the switch files of greatest interest are NCEP_st4 (which will be used in GEFS) and ite_pdlib (which will be used in GFSv17).

The mod_def file defines the grid. Each regtest requires a specific mod_def file and switch file.

Matt is putting together a simpler regtest for w3iopo() and it will come with a mod_def file and will be associated with a specific switch file.

While I wait for that, I'm looking around for mod_def files in the repo and I see:

find ../../.. -name "mod_def*.*"
../../../regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/mod_def.grd2
../../../regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/mod_def.points
../../../regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/mod_def.grd1
../../../regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/mod_def.grd3
../../../regtests/mww3_test_05/work_ST4_PR2_UQ_MPI/mod_def.input
../../../regtests/ww3_tp1.4/work_PR1/mod_def.ww3

I tried the last one on the list, the only one named "mod_def.ww3" which is what the code seems to expect, and I get this error:

 *** WAVEWATCH III ERROR IN W3IOGR :
     UNEXPECTED SOURCE TERM IDENTIFIER 0
          IN mod_def.ww3 FILE : Not defined                   
    EXPECTED FROM switch FILE : Cavaleri and M.-R. (1982)     
     MOD DEF FILE WAS GENERATED WITH A DIFFERENT            
     WW3 VERSION OR USING A DIFFERENT SWITCH FILE.          
     MAKE SURE WW3_GRID IS COMPILED WITH SAME SWITCH        
     AS WW3_SHEL OR WW3_MULTI, RUN WW3_GRID AGAIN           
     AND THEN TRY AGAIN THE PROGRAM YOU JUST USED.          

I then tried the .points file above, renaming it to mod_def.ww3. That got me this error:

*** WAVEWATCH III ERROR IN W3IOGR : UNEXPECTED SOURCE TERM IDENTIFIER 3 IN mod_def.ww3 FILE : Not defined
EXPECTED FROM switch FILE : JONSWAP
MOD DEF FILE WAS GENERATED WITH A DIFFERENT
WW3 VERSION OR USING A DIFFERENT SWITCH FILE.
MAKE SURE WW3_GRID IS COMPILED WITH SAME SWITCH
AS WW3_SHEL OR WW3_MULTI, RUN WW3_GRID AGAIN
AND THEN TRY AGAIN THE PROGRAM YOU JUST USED.

So I think I need to hear from Matt what switch and mod_def file to use to do this work.

edwardhartnett commented 1 year ago

OK, I looked up what switch file was used in the matrix 05 test, and used that with my mod_def.switch file, and now I get a new error, which can only count as some kind of progress:

cmake -DCMAKE_BUILD_TYPE=Debug -DSWITCH=/home/ed/WW3/regtests/mww3_test_05/input/switch_ST4_PR2_UQ_MPI .. && make VERBOSE=1 && ctest The error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f0e91223960 in ???
#1  0x7f0e91222ac5 in ???
#2  0x7f0e90e4251f in ???
    at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#3  0x5601aed89ce9 in __w3snl1md_MOD_insnl1
    at /home/ed/WW3/model/src/w3snl1md.F90:586
#4  0x5601aecfa435 in __w3iogrmd_MOD_w3iogr
    at /home/ed/WW3/model/src/w3iogrmd.F90:1716
#5  0x5601aec3d8ea in test_io
    at /home/ed/WW3/model/tests/test_io.F90:53
#6  0x5601aec3dabc in main
    at /home/ed/WW3/model/tests/test_io.F90:5
Segmentation fault (core dumped)
JessicaMeixner-NOAA commented 9 months ago

@edwardhartnett I think we could use two different methods for choosing between NetCDF or binary output (that could be used for all options moving forward). My guess is we'll eventually make it default to have NetCDF but it will likely be good to have a transition period as well.

Switch:

Add variable to input of ww3_shel.inp/nml

Tagging @MatthewMasarik-NOAA for his awareness for next week.

edwardhartnett commented 9 months ago

OK, I just had a chat with @MatthewMasarik-NOAA about this. What we have concluded:

@JessicaMeixner-NOAA does this sound OK?

JessicaMeixner-NOAA commented 9 months ago

While the global-workflow uses the .inp files, the ufs-weather-model uses .nml files, so we might need to just add both capabilities now. This shouldn't be too huge of a lift and @MatthewMasarik-NOAA or I can likely help with this as needed. I'm curious to see what the additional setting to turn off the netCDF in ww3_shel will be and if that will be sufficient for users who want to use binary files and not compile with NetCDF, but I'm assuming you've already thought that through and so I'll just look forward to learning more later.

JessicaMeixner-NOAA commented 9 months ago

If the .nml is going to be a road-block, we can also proceed with just inp and then soon after follow up with a PR to enable the nml side.

MatthewMasarik-NOAA commented 9 months ago

At least for myself, I think moving ahead with just the .inp first is what I will need to do. One we get that one working, it will be easier to replicate the functionality in the .nml as time allows. @JessicaMeixner-NOAA please let me know though if you think otherwise, and/or have time to work on it yourself.

JessicaMeixner-NOAA commented 9 months ago

Let's do inp for now and let's plan for adding in nml as soon as possible afterwards. Again given that ufs-weather-model only uses nml we're unfortunately in a position where we need both capabilities. nml should be straightforward.

JessicaMeixner-NOAA commented 8 months ago

@edwardhartnett I started with a branch @MatthewMasarik-NOAA shared with me of yours. We then hard-coded the calls so that everything is going to the netcdf version instead of the binary version of the W3IOPO calls. We ran into some errors and so I started looking at what exactly was going on and noticed that several variables are missing time dimensions. The time dimension while mentioned in the headers is not immediately obvious when you read through the code without remembering that you call this routine multiple times (at each requested output frequency) and IPASS is increased each time. I've added some notes as to where the various places are that we need to add the time dimension to in my branch here: https://github.com/JessicaMeixner-NOAA/WW3/tree/feature/pointbinary2nc I also added some other updates such as making sure ".nc" is the extension instead of .ww3 or .{grid} and added the other filename in the case where we are writing a single file per time step.

Is it possible for the time domain to be unlimited in the case where we write all time steps to one file or do we need to know a priori how many time steps we'll be writing? I think adding the time dimension is the next step. (Please note there might be errors in the code that I have, my main goal for now was to get in the major notes about where time should be added etc).

JessicaMeixner-NOAA commented 8 months ago

@edwardhartnett I did some searching and found we can do the unlimited time dimension, so I added that and added the time to one variable in this commit here: https://github.com/JessicaMeixner-NOAA/WW3/commit/f0c8aa923d89c03ce752ad28f20acb6752717066 Quick question, is it ideal to have time as the first or second dimension for these variables in terms of performance in your experience?

edwardhartnett commented 7 months ago

The unlimited dimension should be the last dimension in Fortran (the first in C), for best performance.

Here's a netcdf example program that shows how to use an unlimited dimensions in F90:

https://github.com/Unidata/netcdf-fortran/blob/main/examples/F90/pres_temp_4D_wr.F90

JessicaMeixner-NOAA commented 7 months ago

@edwardhartnett any recommendations on order of time dimension versus the other dimensions?

edwardhartnett commented 7 months ago

Yes, the unlimited dimension should come last. So if the time dimension is unlimited, it should come last.

Basically the order of the dimensions matches what you would do in fortran for efficient data access. That is, you will structure your data and do-loops such that your arrays are access efficiently. The slowest-varying dimension comes last in the list.

So if you had an array:

real :: data(MAX_X, MAX_Y, TIME)

you would order your netCDF dimensions the same way: X, Y, TIME.

JessicaMeixner-NOAA commented 7 months ago

Thanks @edwardhartnett ! Will you be adding in the time variables, or should we just go ahead and do that.

edwardhartnett commented 7 months ago

You should do that, I have to get some grib releases out this week, they are overdue and users are clamoring...

edwardhartnett commented 7 months ago

I will add this code today...

edwardhartnett commented 7 months ago

Which of the variables get the time dimension. All of them? Or just some?

MatthewMasarik-NOAA commented 7 months ago

Hi Ed, I can look into this and get back to you later today

edwardhartnett commented 7 months ago

OK, another thing to consider is the values along the time dimension, in other words, the actual date/times. We need to know what global variables (or whatever) hold those values so we can write them in the netCDF output.