Welcome, Guest
Username: Password: Remember me

TOPIC: Boundary spectra

Boundary spectra 11 years 7 months ago #8126

  • raphael.dubois
  • raphael.dubois's Avatar
Hello,

I have several netcdf spectra files (sea surface wave directional variance spectral density) I want to use as boundary conditions. I understood I had to use the limwac subroutine in my fortran file.

Is there a simple way to read these spectra and to modify the spectral variance density at the boundaries ("fbor") accordingly ? Do I have to concatenate the netcdf files ?

The spectral discretization in my netcdf files is the same I defined in my steering file so I don't need to change "spec" and "fra" is that right ? (spec : variance density frequency spectrum and fra : directional spreading function values)

Raphaël
The administrator has disabled public write access.

Boundary spectra 11 years 6 months ago #8521

  • Elodie
  • Elodie's Avatar
Hello,

Indeed, you have to use the routine limwac.f to program the imposition of your boundary conditions.

I suppose you don't know the spectrum for each of your offshore boundary node? In this case, the easiest way is probably to first program the spatial interpolation of your spectra on the boundary nodes and put it in a seraphin format. There are some softwares that transform netcdf files in ascii files (you can look at the CDO of the Max Planck Institute or MCO). Otherwise you will have to program all the reading and spatial interpolation of your netcdf files in limwac.f.

Then in both cases you will program the reading of your spectra file in limwac.f. You have to give the correct node number in your mesh corresponding to each of your spectrum. Then you can do quite easily the temporal interpolation.

If the spectral discretization in the netcdf files is the same as the one defined in your steering file, it is easier for the interpolation, but I don't understand your question : "I don't need to change "spec" and "fra" is that right ?". You don't need to change the vectors FREQ and TETA, but SPEC and FRA are defined by the formula FBOR=SPEC(f)*FRA(theta). As you directly impose FBOR, you don't need to impose either SPEC or FRA.

Regards,

Elodie
The administrator has disabled public write access.

Boundary spectra 11 years 6 months ago #8524

  • raphael.dubois
  • raphael.dubois's Avatar
Hi,

In my case I had the spectra for each of my boundary nodes available in netcdf files. I modified the limwac.f routine to read them and it worked well, the next step will be spatial interpolation in case there are not enough files / not at the exact nodes coordinates.

I as just surprised there was no easier way to prescribe non-homogeneous boundary spectra ! Besides, I was not too familiar with Fortran so I didn't know if there was a netcdf library (like netCDF4 for python) to make the reading easier. Anyway I made it work now (also, the temporal interpolation).

Thanks for your response,

Raphaël
The administrator has disabled public write access.

Boundary spectra 11 years 5 months ago #8850

  • raphael.dubois
  • raphael.dubois's Avatar
So, to let the other users know, just in case - to deal with netCDF files :
There is a netCDF fortran library which you can find here : www.unidata.ucar.edu/downloads/netcdf/netcdf-fortran/index.jsp

Once it is installed, if you want to use it in a fortran subroutine just add the links to the library (lnetcdff) and to the netcdf.mod file in your systel.cfg. I.E. :

cmd_obj: gfortran -c -O3 -ffixed-line-length-132 -fconvert=big-endian -frecord-marker=4 <mods> <incs> -I /home/raphael/netcdf-fortran-4.2/f90 <f95name>

cmd_exe: /usr/bin/mpif90.openmpi -fconvert=big-endian -frecord-marker=4 -lpthread -v -lm -o <exename> <objs> -Wl,--start-group <libs> -Wl,--end-group -L /usr/local/lib -lnetcdff

Then it works fine for me, I can use all the netCDF functions inside limwac.f as I wanted to.
The administrator has disabled public write access.
Moderators: tfouquet

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.