Problem with setting up inlet_test

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
venuscheung

Problem with setting up inlet_test

#1 Unread post by venuscheung »

hi, i am a new comer in ROMS. I have set up upwelling in my Mac but I face problem with setting up inlet_test for almost two weeks. Hope you guys might help me to figure the problem out.

When i compile ./build_roms.sh, it keep coming the following error:

ocpmix.f90:14:9:

14 | 30.72
| 1
Error: Invalid character in name at (1)
make: *** [/Users/venuscheung/ocean_model/inlet_test/Build_roms/ocpmix.o] Error 1

more information is attached. Please tell me what should i provide more to solve this problem. Thank you.
Attachments
my_build_paths.sh
(12.49 KiB) Downloaded 457 times
build_roms.sh
(11.86 KiB) Downloaded 500 times

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

Re: Problem with setting up inlet_test

#2 Unread post by kate »

Error: Invalid character in name at (1)
make: *** [/Users/venuscheung/ocean_model/inlet_test/Build_roms/ocpmix.o] Error 1
I would look at these files in an editor which shows hidden characters, including the MakeDepend file. The vi(m) mode to see hidden characters is ":set list" - others can say how to do that with other editors. Are you being bitten by a rogue tab character? I can't tell.

venuscheung

Re: Problem with setting up inlet_test

#3 Unread post by venuscheung »

kate wrote: Sun Oct 27, 2019 6:12 pm
Error: Invalid character in name at (1)
make: *** [/Users/venuscheung/ocean_model/inlet_test/Build_roms/ocpmix.o] Error 1
I would look at these files in an editor which shows hidden characters, including the MakeDepend file. The vi(m) mode to see hidden characters is ":set list" - others can say how to do that with other editors. Are you being bitten by a rogue tab character? I can't tell.
Am I suppose to change anything inside ocpmix.o?
btw I am using Mac OS, gfortran as my compiler and open-mpi installing by brew.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#4 Unread post by jcwarner »

the problem here is that SWAN has characters after column 72 that list when the code was updated. for example, the offending line in ocpmix.F is
! logical function EQREAL ( Checks whether REAL1 is appr. 30.72
and as you can see, the 30.72 is actually swan jargon for the version update.

To fix this you need to tell your compiler that certain files are fixed format, and some are free. This is in Compilers/*, where for you i think it would be
Compilers/Linux-gfortran.mk
If you are using swan+roms coupling, i suggest you use COAWST as we have been updating that coupling for many years. In COAWST/Compilers/Linux-gfortran.mk there is

ifdef USE_SWAN

$(SCRATCH_DIR)/ocpcre.o: FFLAGS += -ffixed-form
$(SCRATCH_DIR)/ocpids.o: FFLAGS += -ffixed-form
$(SCRATCH_DIR)/ocpmix.o: FFLAGS += -ffixed-form
....

so that should take care of it. Can you check your version of Linux-gfortran??
-j

venuscheung

Re: Problem with setting up inlet_test

#5 Unread post by venuscheung »

jcwarner wrote: Mon Oct 28, 2019 4:08 pm the problem here is that SWAN has characters after column 72 that list when the code was updated. for example, the offending line in ocpmix.F is
! logical function EQREAL ( Checks whether REAL1 is appr. 30.72
and as you can see, the 30.72 is actually swan jargon for the version update.

To fix this you need to tell your compiler that certain files are fixed format, and some are free. This is in Compilers/*, where for you i think it would be
Compilers/Linux-gfortran.mk
If you are using swan+roms coupling, i suggest you use COAWST as we have been updating that coupling for many years. In COAWST/Compilers/Linux-gfortran.mk there is

ifdef USE_SWAN

$(SCRATCH_DIR)/ocpcre.o: FFLAGS += -ffixed-form
$(SCRATCH_DIR)/ocpids.o: FFLAGS += -ffixed-form
$(SCRATCH_DIR)/ocpmix.o: FFLAGS += -ffixed-form
....

so that should take care of it. Can you check your version of Linux-gfortran??
-j
the attached file is my Linux-gfortran, but seems nothing special.
Attachments
Linux-gfortran.mk
(11.12 KiB) Downloaded 459 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#6 Unread post by jcwarner »

if you type
uname -s
what comes back?
can you send the whole build log?
-j

venuscheung

Re: Problem with setting up inlet_test

#7 Unread post by venuscheung »

jcwarner wrote: Mon Oct 28, 2019 7:32 pm if you type
uname -s
what comes back?
can you send the whole build log?
-j
venuscheungsMBP:inlet_test_romsG venuscheung$ uname -s
Darwin

the attached is the build log

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#8 Unread post by jcwarner »

ok so you need to edit
Compilers/Darwin-gfortran.mk

can you send the whole build.log? so i can see what flags are being issued? Look at the FFLAGS and make sure it is sending the Fixed format options.

venuscheung

Re: Problem with setting up inlet_test

#9 Unread post by venuscheung »

jcwarner wrote: Tue Oct 29, 2019 5:29 pm ok so you need to edit
Compilers/Darwin-gfortran.mk

can you send the whole build.log? so i can see what flags are being issued? Look at the FFLAGS and make sure it is sending the Fixed format options.
sorry I didnt notice that the file is failed to attach.
Attachments
log.txt
(282.23 KiB) Downloaded 443 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#10 Unread post by jcwarner »

ok the search continues. it has

cd /Users/venuscheung/ocean_model/inlet_test_romsG/Build_roms; /usr/local/Cellar/open-mpi/4.0.2/bin/mpif90 -c -frepack-arrays -O3 -I/usr/local/MCT/include -ffixed-form ocpmix.f90
ocpmix.f90:14:9:

14 | 30.72
| 1
Error: Invalid character in name at (1)
can you send to me the ocpminx.f90 file. -j

venuscheung

Re: Problem with setting up inlet_test

#11 Unread post by venuscheung »

jcwarner wrote: Wed Oct 30, 2019 1:57 am ok the search continues. it has

cd /Users/venuscheung/ocean_model/inlet_test_romsG/Build_roms; /usr/local/Cellar/open-mpi/4.0.2/bin/mpif90 -c -frepack-arrays -O3 -I/usr/local/MCT/include -ffixed-form ocpmix.f90
ocpmix.f90:14:9:

14 | 30.72
| 1
Error: Invalid character in name at (1)
can you send to me the ocpminx.f90 file. -j
I cant find my ocpmix.f90 in the build file but i have the original file in WAVE/SWAN/
Attachments
ocpmix.F
(93.76 KiB) Downloaded 460 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#12 Unread post by jcwarner »

no i need to see the .f90
i need to see what the compiler is seeing on that line.

venuscheung

Re: Problem with setting up inlet_test

#13 Unread post by venuscheung »

jcwarner wrote: Wed Oct 30, 2019 3:01 am no i need to see the .f90
i need to see what the compiler is seeing on that line.
oh I just found out that I have searched inside a wrong directory, here's my ocpmix.f90 and .o.
Attachments
ocpmix.F
(93.76 KiB) Downloaded 443 times
ocpmix.f90
(93.58 KiB) Downloaded 435 times
Last edited by venuscheung on Wed Oct 30, 2019 3:17 am, edited 1 time in total.

venuscheung

Re: Problem with setting up inlet_test

#14 Unread post by venuscheung »

venuscheung wrote: Wed Oct 30, 2019 3:09 am
jcwarner wrote: Wed Oct 30, 2019 3:01 am no i need to see the .f90
i need to see what the compiler is seeing on that line.
oh I just found out that I have searched inside a wrong directory, here's my ocpmix.f90 and .o.
ummmm...sorry again. These should be the correct file. Please ignore the previous files.
Attachments
ocpmix.f90
(93.43 KiB) Downloaded 485 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#15 Unread post by jcwarner »

ok i can see the problem now. for some reason, when your code does the cpp preprocessing it changes line 14 from
! equal to REAL2 ) 30.72
to
30.72

the pre-processor tries to clean up the code a bit, and for some reason it is messing this up. It looks like the rest of the
Do me a favor and edit SWAN/Src/ocpmix.F and remove these lines:

! logical function EQREAL ( Checks whether REAL1 is appr. 30.72
! equal to REAL2 ) 30.72

just delete those 2 lines in the .F, recompile, and lets see.
-j

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Problem with setting up inlet_test

#16 Unread post by robertson »

The problem is the version of cpp that comes with Xcode. It's likely that Homebrew (I know Macports does) has a working cpp you can use instead. I would suggest you:
  1. Make a ~/Compilers/ROMS directory (mkdir -p ~/Compilers/ROMS)
  2. Place a copy of the Darwin-gfortran.mk file from the Compilers directory of your ROMS source code into the directory above.
  3. Update the "COMPILERS" variable in your build script to point to this directory.
  4. Edit ~/Compilers/ROMS/Darwin-gfortran.mk and change the line "CPP := /usr/bin/cpp" to "CPP:= /usr/local/bin/cpp" or whatever the path to the Homebrew cpp executable is.
What is happening is that the cpp from Xcode handles multi-line C-style comments in a strange way. So from this:

Code: Select all

!     FOR
!     logical function EQREAL /* Checks whether REAL1 is appr.            30.72
!                                equal to REAL2                 */        30.72
!     LSPLIT            /* splits an input line into data items */        40.00
!     BUGFIX                                                              40.03
The Xcode cpp removes all the text between and including "/* Checks" and "REAL2 */" but leaves the line return for some odd reason. Leaving you with:

Code: Select all

!     FOR
!     logical function EQREAL 
        30.72
!     LSPLIT                    40.00
!     BUGFIX                                                              40.03
instead of:

Code: Select all

!     FOR
!     logical function EQREAL         30.72
!     LSPLIT                    40.00
!     BUGFIX                                                              40.03
Notice that the single-line comment (/* splits an input line into data items */) is handled correctly. There may be a flag to remedy this but I don't know it.

venuscheung

Re: Problem with setting up inlet_test

#17 Unread post by venuscheung »

one very silly question...but may I ask should I do anything for the MCT and ARPACK file under Lib?
Or I should make and install them?
Thank you

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#18 Unread post by jcwarner »

i suggest that you should be using COAWST for roms + swan coupling. We distribute a manual that has explanations of the inlet test and many other test cases. also how to compile and install mct. we dont use arpack.
if you need coawst, send me an email to jcwarner@usgs.gov
the same swan issue will be in my version, as swan is from a different group.
-j

venuscheung

Re: Problem with setting up inlet_test

#19 Unread post by venuscheung »

jcwarner wrote: Wed Oct 30, 2019 5:07 pm i suggest that you should be using COAWST for roms + swan coupling. We distribute a manual that has explanations of the inlet test and many other test cases. also how to compile and install mct. we dont use arpack.
if you need coawst, send me an email to jcwarner@usgs.gov
the same swan issue will be in my version, as swan is from a different group.
-j
Thank you for your help. I have sucessfully compile romsM but still some problem in running it.
May I ask what is special about coupling roms and swan using COAWST.

Really THANK A LOT

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#20 Unread post by jcwarner »

we have been advancing the coupling to swan a lot more, it will be a more recent version of swan, we also added more wave current interactions, more sediment algorithms, vegetation/marsh, wave watch 3 coupling, wrf coupling, infragravity wave model, new wave-current asymmetry bedload, ... bunch of stuff.

venuscheung

Re: Problem with setting up inlet_test

#21 Unread post by venuscheung »

jcwarner wrote: Wed Oct 30, 2019 5:29 pm we have been advancing the coupling to swan a lot more, it will be a more recent version of swan, we also added more wave current interactions, more sediment algorithms, vegetation/marsh, wave watch 3 coupling, wrf coupling, infragravity wave model, new wave-current asymmetry bedload, ... bunch of stuff.
when I run mpirun -np 2 ./romsM coupling_inlet_test.in > run.log 2>&1, it gives out error but I have already check all file is in the correct path and directory...
Attachments
run.log
(1.9 KiB) Downloaded 431 times

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

Re: Problem with setting up inlet_test

#22 Unread post by kate »

And yet:
INP_PAR - Unable to open ROMS/TOMS input script file.
coupling_inlet_test.in is in your current run directory? Plus any files it refers to?

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#23 Unread post by jcwarner »

this is the Rutgers way of specifying the coupling:
Ocean Export: bath:SSH:Ubar:Vbar:ZO
Waves Export: Wdir:Wamp:Wlen:Wptop:Wpbot:Wubot

i will send you the coawst way in a minute.
-j

venuscheung

Re: Problem with setting up inlet_test

#24 Unread post by venuscheung »

kate wrote: Thu Oct 31, 2019 5:09 pm And yet:
INP_PAR - Unable to open ROMS/TOMS input script file.
coupling_inlet_test.in is in your current run directory? Plus any files it refers to?
yes, coupling file is in my directory.

cloudy4568
Posts: 39
Joined: Thu Oct 17, 2019 8:56 pm
Location: Clarkson University

Re: Problem with setting up inlet_test

#25 Unread post by cloudy4568 »

jcwarner wrote: Wed Oct 30, 2019 5:29 pm we have been advancing the coupling to swan a lot more, it will be a more recent version of swan, we also added more wave current interactions, more sediment algorithms, vegetation/marsh, wave watch 3 coupling, wrf coupling, infragravity wave model, new wave-current asymmetry bedload, ... bunch of stuff.
Hi jcwarner,

How is the coupling of Roms and Wave watch iii now? Is it still in progress? If so, when will it be completed? :D

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#26 Unread post by jcwarner »

yes we have roms wrf ww3 swan coupling in the coawst system. if you send me an email, i can add you to that distribution.
jcwarner@usgs.gov
-j

hzh_1211

Re: Problem with setting up inlet_test

#27 Unread post by hzh_1211 »

jcwarner wrote: Tue Feb 18, 2020 1:29 am yes we have roms wrf ww3 swan coupling in the coawst system. if you send me an email, i can add you to that distribution.
jcwarner@usgs.gov
-j
Hi jcwarner, can you help me to solve the WW3 running errors.
I tried to run the case of sandy using COAWST-V3.5, where the input data used the existing files in the Sandy folder and the configure file (*.in, *.h and *.inp) used the default parameters. I can successfully run the fully coupled application that WRF + ROMS + SWAN, but I melt an error when running WW3-only (WW3-V6.07.1) according to the user manual.
Running environment:
  • Ubuntu 18.04LTS
  • gfortran 7.4.0
  • mpich 3.3a2
  • netcdf-fortran 4.4.4
  • netcdf-C 4.6.1
The operation steps are as follows

1. compile COAWST ok
2. ./ww3_grid ok
3. ./ww3_strt ok
4. ./ww3_prep ok
5. mpirun -np 2 ./coawstM ww3_grid.inp fail
Please see the attachment for the corresponding log file.

Error information as follow:

Code: Select all

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

  Comment character is '$'


  Input fields : 
 --------------------------------------------------
       ice param. 1   ---/NO                      
       ice param. 2   ---/NO                      
       ice param. 3   ---/NO                      
       ice param. 4   ---/NO                      
       ice param. 5   ---/NO                      
       mud density    ---/NO                      
       mud thkness    ---/NO                      
       mud viscos.    ---/NO                      
       water levels   ---/NO                      
       currents       ---/NO                      
       winds          YES/--                      
       ice fields     ---/NO                      
       mean param.    ---/NO                      
       1D spectra     ---/NO                      
       2D spectra     ---/NO                      
 

 *** WAVEWATCH III WARNING  : 
     NUMBER OF REQUESTED OUTPUT FIELD FLAGS IN GROUP  2
 LESS THAN AVAILABLE, CHECK DOCS FOR MORE OPTIONS

 *** WAVEWATCH III WARNING  : 
     NUMBER OF REQUESTED OUTPUT FIELD FLAGS IN GROUP  4
 LESS THAN AVAILABLE, CHECK DOCS FOR MORE OPTIONS

 *** WAVEWATCH III WARNING  : 
     NUMBER OF REQUESTED OUTPUT FIELD FLAGS IN GROUP  6
 LESS THAN AVAILABLE, CHECK DOCS FOR MORE OPTIONS
            Fields   : Water depth         
                       Current vel.        
                       Wind speed          
                       Air-sea temp. dif.  
                       Water level         
                       Wave height         
                       Mean wave length    
                       Mean wave period(+2)
                       Mean wave period(-1)
                       Mean wave period(+1)
                       Peak frequency      
                       Mean wave dir. a1b1 
                       Mean dir. spr. a1b1 
                       Peak direction      
                       Part. wave height   
                       Part. peak period   
                       Part. peak wave len.
                       Part. mean direction
                       Part. dir. spread   
                       Part. wind sea frac.
                       Part. peak direction
                       Part. peakedness    
                       Friction velocity   
                       Charnock parameter  
                       Energy flux         
                       Wind-wave enrgy flux
                       Wind-wave net mom. f
                       Wind-wave neg.mom.f.
                       Whitecap coverage   
                       Whitecap mean thick.
                       Mean breaking height
                       Dominant break prob 
                       Radiation stresses  
                       Wave-ocean mom. flux
                       wave ind p Bern Head
                       Wave-ocean TKE  flux
                       Stokes transport    
                       Stokes drift at z=0 
                       2nd order pressure  
                       Bottom rms ampl.    
                       Bottom rms velocity 
                       Bedform parameters  
                       Energy diss. in WBBL
                       Moment. loss in WBBL
                       Mean square slopes  
                       Phillips tail const 
                       Slope direction     
                       Tail slope direction
                       Goda peakedness parm
                       Undefined / Not Used
                       Avg. time step.     
                       Cut-off freq.       
                       Maximum spatial CFL 
                       Maximum angular CFL 
                       Maximum k advect CFL
At line 394 of file w3iogomd.F90
Fortran runtime error: Unit number is negative and unit was not already opened with OPEN(NEWUN

Error termination. Backtrace:
#0  0x14a85eba52da in ???
#1  0x14a85eba5ec5 in ???
#2  0x14a85eba668d in ???
#3  0x14a85ed1f7fb in ???
#4  0x55a3ca681f4e in __w3iogomd_MOD_w3readflgrd
	at /home/henry/coawst/COAWST/WW3/model/tmp/w3iogomd.F90:394
#5  0x55a3ca54ed59 in ww3_init_
	at /home/henry/coawst/COAWST/WW3/model/tmp/ww3_shel.F90:1236
#6  0x55a3ca54b0a1 in ???
#7  0x55a3ca54af32 in ???
#8  0x14a85e204b96 in ???
#9  0x55a3ca54af69 in ???
#10  0xffffffffffffffff in ???
Attachments
ww3_strt.log
(6.12 KiB) Downloaded 408 times
ww3_prep.log
(4.7 KiB) Downloaded 453 times
ww3_grid.log
(25.22 KiB) Downloaded 412 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Problem with setting up inlet_test

#28 Unread post by jcwarner »

looks like it cant find a file, maybe the wind file or the setup file.??
can you send to me
/home/henry/coawst/COAWST/WW3/model/tmp/w3iogomd.F90
/home/henry/coawst/COAWST/WW3/model/tmp/ww3_shel.F90

i can look on those line numbers and see what file it is trying to find.
WW3 does a lot of soft links (not my favorite thing) to input files, so you need to be careful. Let me see what is on those files and i can try it here.
-j

hzh_1211

Re: Problem with setting up inlet_test

#29 Unread post by hzh_1211 »

jcwarner wrote: Tue Mar 17, 2020 1:56 pm looks like it cant find a file, maybe the wind file or the setup file.??
can you send to me
/home/henry/coawst/COAWST/WW3/model/tmp/w3iogomd.F90
/home/henry/coawst/COAWST/WW3/model/tmp/ww3_shel.F90

i can look on those line numbers and see what file it is trying to find.
WW3 does a lot of soft links (not my favorite thing) to input files, so you need to be careful. Let me see what is on those files and i can try it here.
-j
Thank you for your reply, here are the two .F90 files. I am very appreciate for your help if you can give me some advice.
Attachments
ww3_shel.F90
(75.46 KiB) Downloaded 385 times
w3iogomd.F90
(139.42 KiB) Downloaded 383 times

Post Reply