how build tidal forcing

Facts, news, and guidance about ROMS software

Moderators: arango, robertson

Post Reply
Message
Author
mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

how build tidal forcing

#1 Unread post by mariafattorini »

Hello all,
I am studying to build my first application.

About my application, I have tide data at two points of the domain. The wikipage ‘Tidal Forcing Files in ROMS’ say that I should interpolate the tidal constituent database to the desired ROMS grid. I don’t
understand how I have to do this interpolation. Is it limited to the points of the boundaries or does it refer to all points within the domain?
Is there any software facility particularly suited to do the interpolation and to produce the proper netcdf file for ROMS input.
Moreover, considering that my domain is of the order of 200x200 km and that I know the tidal time series at only 2 shore stations (one on the north and the other on the south boundary), I wonder if it is enough or not.

Any comments would be appreciated.

Thanks in advance;
Maria

ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

Re: how build tidal forcing

#2 Unread post by ocecept »

Hi Maria;

Have a look in the following wiki page https://www.myroms.org/wiki/index.php/Tidal_Forcing. It will answer most of your questions. You will find the software to create the tidal forcing from global (with luck regional) models.

I'm using the OSU Tidal Prediction and the results are quite good for my region. I had to extend my first grid offshore, because the tidal model available to my region was not doing a good job in the coastal region.

I'm sure you can use the tidal information you have, but I'm not sure if there is any software available to do it.

Good luck!

Carlos

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: how build tidal forcing

#3 Unread post by fdaryabor »

Hi
Also you can use matlab toolbox in Roms_Agrif following address:
1) http://roms.mpl.ird.fr/Data/Preprocessi ... 009.tar.gz
2) http://roms.mpl.ird.fr/Data/Tides_2006_10_05.tar.gz
Best Regards
F.Daryabor

Center for Tropical and Climate Change System
Faculty of Science and Technology
National University of Malaysia
Bangi,43600
Selangor/Malaysia

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: how build tidal forcing

#4 Unread post by mariafattorini »

Hello,
Thank you very much to Carlos and F.Daryabor.

I have tried to use OSU Tidal Prediction, as suggested by Carlos and by Wikipage, but I found some problems.
I am working on my Window Vista PC by CYGWIN.
I have saved the OTPSnc package and the Mediterranean Model within the ‘home’ directory. There are the following files in the OTPSnc directory:

constit.h
dumsetup
extract_HC.f
lat_lon_time
makefile
mk_lltime.m
predict_tide.f
READ ME
Setup.inp
Subs.f
Tpxo7.out
Weights.h
DATA / load_file.nc
/Model_load
/Model_tpxo7.1


Following the instructions in the READ ME file:

1. Open the makefile e change it in the following linee:

ARCH = $(shell uname -s)
ifeq ($(ARCH),CYGWIN)
FC =
gfortran-4
NCLIB = c:/cygwin/usr/local/lib
NCINCLUDE = c:/cygwin/usr/local/include
endif
ifeq ($(ARCH),Linux)
FC = pgf90
NCLIB = /usr/local/lib
NCINCLUDE = /usr/local/include
endif

predict_tide: predict_tide.f subs.f constit.h
$(FC) -o predict_tide predict_tide.f subs.f -L$(NCLIB) -lnetcdf -I$(NCINCLUDE)
rm *.o
extract_HC: extract_HC.f subs.f
$(FC) -o extract_HC extract_HC.f subs.f -L$(NCLIB) -lnetcdf -I$(NCINCLUDE)
rm *.o



2. Save the file and in CYGWIN type:

$ dos2unix -U makefile
$ gmake extract_HC


but CYGWIN don’t found the ‘gmake’ command.

Does someone know what I can do to run ‘OSU Tidal Prediction’ on the CYGWIN platform?

Thank you in advance for any suggest;
Maria

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: how build tidal forcing

#5 Unread post by mariafattorini »

Well, I perhaps understood the source of my problem:
I simply haven't the gmake command!!!
So I have downloaded the gmake package from the web
page "http://mirtchovski.com/p9/gmake/", and I am trying to install it.


thanks and bye,
Maria

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: how build tidal forcing

#6 Unread post by mariafattorini »

Hello, sorry again

I discovered that I already had the package of gmake, or at least I think. Gmake is inlcuded in the ‘make’ package which is found in the CYGWIN's setup, is it right?

So I don't understand why the CYGWIN doesn't find gmake command when it is called from the command line.

I sent a mail to the site of CYGWIN but I have not yet been answered.

I hope in your suggestion or indication.

Thanks a lot,
Maria

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: how build tidal forcing

#7 Unread post by kate »

If your "make" is actually gmake, type "make" to invoke it. Some people rename it to gmake so as to not conflict with a different make that comes with other operating systems.

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: how build tidal forcing

#8 Unread post by mariafattorini »

Hello all,

thanks to Kate for your reply.

Trying to create tidal forcing input file using OSU Tidal Prediction, I have found some problems.
I am working on my Window Vista PC by CYGWIN.

Following the instructions in the READ ME file:
- Open the makefile e change it in the following red lines:
ARCH = $(shell uname -s)
ifeq ($(ARCH),
CYGWIN_NT-6.0)
FC =
gfortran-4
NCLIB = C:/cygwin/usr/local/lib
NCINCLUDE = C:/cygwin/usr/local/include
endif
ifeq ($(ARCH),Linux)
FC = pgf90
NCLIB = C:/cygwin/usr/local/lib
NCINCLUDE = C:/cygwin/usr/local/lib
endif

predict_tide: predict_tide.f subs.f constit.h
$(FC) -o predict_tide predict_tide.f subs.f -L$(NCLIB) -lnetcdf -I$(NCINCLUDE)
rm *.o
extract_HC: extract_HC.f subs.f
$(FC) -o extract_HC extract_HC.f subs.f -L$(NCLIB) -lnetcdf -I$(NCINCLUDE)
rm *.o



- Save the file and in CYGWIN type:
$ dos2unix –U makefile
$ gmake extract_HC


The result of those operations is the followed:
$ make extract_HC
gfortran-4 -o extract_HC extract_HC.f subs.f -LC:/cygwin/usr/local/lib -lnetcdf
-IC:/cygwin/usr/local/include
extract_HC.f:228.51:
* real(z1(ic)*180/3.141593),ic=1,ncon)
1
Error: Syntax error in WRITE statement at (1)
extract_HC.f:231.34:
* ((real(z1(ic)),imag(z1(ic))),ic=1,ncon)
1
Error: Expected a right parenthesis in expression at (1)
make: *** [extract_HC] Error 1


I have opened the “extract_HC.f” file and I have added the indicate parenthesis without good results.
Does someone know what is wrong in this file.f? I have read in a forum that perhaps the above style is not accepted by some gnu compiler. So, does someone know a compiler that accepts the style of extract_HC (OPTSnc)?

I hope in your suggestion or indication.

Thanks a lot,
Maria

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: how build tidal forcing

#9 Unread post by mariafattorini »

Hello all,
I have compiled OTPSnc by gfortran-4, modifying makefile as my above post described.
So, I have found some errors in the OTPSnc code that I reported below since they could be useful to other users:

- File extract_HC Errors at row 231
ORIGINAL FRAGMENT
231) write(11,fmt)lat(k),lon0(k),
232) * ((real(z1(ic)),imag(z1(ic))),ic=1,ncon)
CORRECTED FRAGMENT
231) write(11,fmt)lat(k),lon0(k),
232) * (real(z1(ic)),imag(z1(ic)),ic=1,ncon)

- File predict_HC Errors at row 18
ORIGINAL FRAGMENT
real zpred(:),upred(:),vpred(:)
CORRECTED FRAGMENT
real,allocatable:: zpred(:),upred(:),vpred(:)

Now the "extract_HC.f" and "predict_HC.f" files are successfully compiled and their executables runs!!

Bye bye, Maria

mdiezm

Re: how build tidal forcing

#10 Unread post by mdiezm »

Dear all,

In order to compile (gfortran4.3) the extract_HC.f file, I also had to modify the line 227 and 228 as follows:

! This is the corrected code.


if(APRI)then ! line 226
write(11,fmt)lat(k),lon0(k),(abs(z1(ic)),(atan2(-imag(z1(ic)),
* real(z1(ic)))*180/3.141593),ic=1,ncon)
else
write(11,fmt)lat(k),lon0(k),
* (real(z1(ic)),imag(z1(ic)),ic=1,ncon)
endif
else

Best,
Manuel.

wrh
Posts: 23
Joined: Fri Nov 14, 2008 4:26 pm
Location: zhejiang ocean university

Re: how build tidal forcing

#11 Unread post by wrh »

hi all:
could you help me??

gfortran -o extract_HC extract_HC.f subs.f
extract_HC.f:204.36:

* ((trim(c_id(ic)),'_amp ',
1
Error: Expected a right parenthesis in expression at (1)
extract_HC.f:208.35:

* ((trim(c_id(ic)),'_Re ',
1
Error: Expected a right parenthesis in expression at (1)
make: *** [extract_HC] Error 1

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: how build tidal forcing

#12 Unread post by wilkin »

I encountered the same problem when using gfortran on a Macbook. Take out the extra parentheses, i.e. ( ), in the implied do loop in the offending fortran statement, and it should then compile. Yes, this potentially makes the code ambiguous but in this case there is not a problem.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply