Compile extract_HC error

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
liangliang
Posts: 61
Joined: Mon Jul 20, 2009 2:41 pm
Location: Port And Costal Engineering Laboratory

Compile extract_HC error

#1 Unread post by liangliang »

Hi all:
when I compile extract_HC ,the following error is shown:

f77 -o extract_HC extract_HC.f subs.f -L -I
make: f77: Command not found
make: *** [extract_HC] Error 127


my compile is gfortran , and I type make extract_HC on Cygwin.
makefile is like that :
ARCH = $(shell uname -s)
ifeq ($(ARCH),CYGWIN_NT-6.1)
FC = gfortran-4
NCLIB = /home/Administrator/Install/netcdf-4.1.3-1/lib
NCINCLUDE = /home/Administrator/Install/netcdf-4.1.3-1/include
NCLIBS= -lnetcdf -lnetcdff
endif

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


Any guess of how to sort this problem out?

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

Re: Compile extract_HC error

#2 Unread post by kate »

You've told it that FC is gfortran-4. Is that in your $PATH?

liangliang
Posts: 61
Joined: Mon Jul 20, 2009 2:41 pm
Location: Port And Costal Engineering Laboratory

Re: Compile extract_HC error

#3 Unread post by liangliang »

kate wrote:You've told it that FC is gfortran-4. Is that in your $PATH?
Thank you for your reply , Kate .
Yes ,it's in my path .I have compiled ROMS with gfortran-4 before ,and it work well.
I didn't know why it show an error now . I see some people have succeed compiling extract_HC with gfortran-4 in this forum . Could you give me some advice ? Thank you !

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

Re: Compile extract_HC error

#4 Unread post by kate »

Ah, I now see that setting FC to gfortran-4 is inside of an if statement. How about commenting out the if test?

liangliang
Posts: 61
Joined: Mon Jul 20, 2009 2:41 pm
Location: Port And Costal Engineering Laboratory

Re: Compile extract_HC error

#5 Unread post by liangliang »

kate wrote:Ah, I now see that setting FC to gfortran-4 is inside of an if statement. How about commenting out the if test?
Hi kate :
Thank you for your help ! It's very useful, I compile it successful . I can see extract_HC.exe in my folder .
But when I generate ROMS forcing file with matlab , it show an error . Could you give me some advice ?
-Chenzhen

Type in matlab
>> t=datenum(2005,1,1);
tpred=datenum(2006,1,1);
gfile='G:\bohai\bath\bohai_grid.nc';
otps2frc_v3(gfile,t,tpred,'test_EC.nc','G:\Cygwin\home\Administrator\OSU\OTPSnc\DATA\Model_tpxo7.2')

matlab shows
Gridfile G:\bohai\bath\bohai_grid.nc lat/lon written to ./ll.dat
Mode parameter file used: G:\Cygwin\home\Administrator\OSU\OTPSnc\DATA\Model_tpxo7.2
Generating parameter file for z
Extracting z Harmonics

*******************************************
'extract_HC' 'not recognized as an internal or external command, operable program or batch file。

*******************************************
Generating parameter file for u
Extracting u Harmonics

*******************************************
'extract_HC' 'not recognized as an internal or external command, operable program or batch file。

*******************************************
Generating parameter file for v
Extracting v Harmonics

*******************************************
'extract_HC' 'not recognized as an internal or external command, operable program or batch file。

*******************************************
Reading otps_harmonics_z...
Error using read_otps_output (line 35)
read_otps_output: fopen failed on otps_harmonics_z.


Error in otps2frc_v3 (line 76)
[z_hc,lon,lat] = read_otps_output([harmonics_prefix vars(1)]);

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

Re: Compile extract_HC error

#6 Unread post by kate »

Clearly, the matlab is trying to execute something called "extract_HC" while what you have is "extract_HC.exe". Perhaps you should change the matlab code to add the ".exe" and see what happens.

liangliang
Posts: 61
Joined: Mon Jul 20, 2009 2:41 pm
Location: Port And Costal Engineering Laboratory

Re: Compile extract_HC error

#7 Unread post by liangliang »

kate wrote:Clearly, the matlab is trying to execute something called "extract_HC" while what you have is "extract_HC.exe". Perhaps you should change the matlab code to add the ".exe" and see what happens.
Your are right !
In otps2frc_v3.m, there is a line of code
[s,w]=unix('extract_HC < otps_input');

my operating system is win7 64 bits , and I compile ROMS and extract_HC on Cygwin .But my matlab installed on win7 . How should I fix this problem ?

Post Reply