Is there any existing documentation on the WAM namelists?

I need to know how to turn it on to write output?

I couldn't find any information on the parameters in the namelist (there are two namelists, wam_namelist and wam_namelist_coupled_000, what is their difference?) and I would need significant wave height (SWH), mean wave direction (MWD) and mean wave period (MWP).

8 Comments

  1. Unknown User (nagc)

    Hi Meri,

    The two wam namlists are identical. It's just a 'feature' of the way I extract the initial files from our system (I've been meaning to fix that : ).  The model will expect to find wam_namelist, so that is the one to edit.

    The namelist variable in wam_namelist to change is 'GFLAG'; 'G' stands for GRIB. GFLAG is a logical array of switches, each element of the array corresponds to a particular wave model field. To see the list of model fields possible have a look in the code at the file src/Wam_oper/userin.F around line 239.

    So for example, if you want to set output of SWH, MWD, MWP,  (grib codes 229, 230,  232 in table 140), following the code comment in userin.F it would be:

    GFLAG(1)=.T.,
    GFLAG(2)=.T.,
    GFLAG(3)=.T.,

    I have made a note to add a description of the output of wave model parameters to the OpenIFS User Guide.

    Let me know if it does or doesn't work.

       Glenn

  2. Unknown User (nagc)

    Meri,

    Attached is a script that you can use to set the GFLAGS part of the WAM namelist file in case it's useful.

    Pass it a string of grib codes and it will write out GFLAGS that you can then cut'n'paste into wam_namelist  e.g.

    % wave_setgflag "229/230/232"
    GFLAG(1)=T
    GFLAG(2)=T
    GFLAG(3)=T
    GFLAG(4)=F
    GFLAG(5)=F
    ......

       Glenn

    Bash script: wave_setgflag

  3. Thank you Glenn! The userin.F-file helped to clarify a lot and now I got the outputfile (MPP********) with the selected parameters.

  4. Unknown User (nagc)

    Great, thanks for letting me know. I will update the user guide as soon as I get time.

  5. Hi again Glenn! Do you (or someone else) happen to know how to convert the output grib-file into netcdf without loosing the latitude-longitude information? Or is there a different way the grid is displayed in the output?

    I tried this

    $ cdo -f nc copy  MPP20180207000168 MPP20180207000168.nc

    but these are thedimensions in the nc-files:


        gsize = 315258 ;
        time = UNLIMITED ; // (29 currently)


    EDIT: I realized there is no lat,lon-information in the grib-file either... Is there a way to include the lat,lon-grid in the output?

    The cdo sinfo command gives information that grid coordinates are "generic" with points = 315258 .

  6. Unknown User (nagc)

    Hi Meri,

    What resolution are you running OpenIFS at? The WAM grid changes form with higher resolutions.

    When I run OpenIFS at T159 I get a regular lat-lon grid from the WAM model in the MPP* GRIB output file.

    If I do a 'grib_dump' on that file I can see the following parameters (grib_dump comes with grib_api or eccodes libraries):

    grib_dump MPP20171201000024
    ... lots of output....
      Ni = 240;
      Nj = 121;
      latitudeOfFirstGridPointInDegrees = 90;
      longitudeOfFirstGridPointInDegrees = 0;
      earthIsOblate = 0;
      uvRelativeToGrid = 0;
      latitudeOfLastGridPointInDegrees = -90;
      longitudeOfLastGridPointInDegrees = 358.5;

    This is a regular lat-lon grid with 121 latitudes from -90 to 90 and 240 longitude points starting at 0 degrees longitude.

    However at higher resolutions the WAM model uses a semi-regular grid, equal spacing in latitude but irregular in longitude. In this case, you will see:

    Ni = Missing;

    in the grib dump and there will be a new grib key called 'pl' which lists the number of longitude points per latitude.

    I am not that familiar with cdo but I would guess it should be able to handle the first case but not necessarily the second. I will ask here if someone knows how to do it.

    Alternately if you have metview installed in Helsinki then you can use a simple metview macro to do the interpolation to a regular grid and then cdo or grib_to_netcdf to do the conversion to netcdf for you.

    #Metview Macro
    # will interpolate  on a 0.36x0.36 grid an input grib file specified by 'source'
    # to output file: mpp_reg.grb
    
    input = read(
        source   : "MPP20171201000024",
        grid     : [0.36,0.36]
        )
    
    output = write( "mpp_reg.grb", input )

    Save this metview macro in your metview directory as, say, mpp.mv, put the MPP* file in the same directory and then run it with metview in batch (or start metview and right click 'execute'):

    metview -b mpp.mv

    and this will give you a regular lat-lon GRIB file that cdo should be able to handle. If not, try the grib_to_netcdf command that comes with either grib_api or eccodes. You should already have this on your system if you are running OpenIFS.

    Note that you will probably need to change the 'grid' values above to match the WAM resolution you have. I suggest setting it to the spacing of latitudes as given by the 'grib_dump' above.

    Hope that helps. If I find a cdo solution I will let you know (or if you figure it out let me know).

     Cheers,  Glenn

    p.s. with thanks to our resident wave model expert for explaining this to me


  7. Hi Glenn,


    Thank you again for a quick and thorough response!


    The resolution in my run is T639.

    The grib_dump shows that Ni = missing. However, the Metview macro worked and now I have a regular grid, so many thanks for you and your wave model expert for explainig this to me!

  8. Unknown User (nagc)

    Hi Meri,

    Glad that worked. I checked with our user support and they don't know how cdo might be used with the wave model output. That doesn't mean it can't do it, but we don't know how.

    For the metview macro, you can embed it into a bash script to make it a command line tool. The macro can accept command line arguments or you can use environment variables.

    There's a description here: Running Metview in Batch Mode  which explains how to use arguments to the 'metview -b' (metview batch) command, and also shows how to use the grib data examiner and plotting without starting up full metview. Metview 'batch' is just where it doesn't start up the interactive brower.

    Hope that helps,   Glenn