Nesting Issue at Compile

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
bhayward
Posts: 11
Joined: Thu Aug 31, 2023 3:51 pm
Location: University of Maine

Nesting Issue at Compile

#1 Unread post by bhayward »

Hello,

I'm still working on making sure I've updated to version 4.2, and am working on getting nesting working in the dogbone test case. When I try to compile, I get the following error.

Code: Select all


post_initial.f90(70): error #6404: This name does not have a type, and must have an explicit type.   [NGETD]
        CALL nesting (ng, model, ngetD)
---------------------------------^
compilation aborted for post_initial.f90 (code 1)
make: *** [/home/bhayward/roms_project/dogbone5/Refined/Build_romsO/post_initial.o] Error 1

It looks like ngetD is defined in mod_nesting.F, and that it's not getting defined before getting to this line? The version of ROMS I was using before updating did not have this line, which may be a hint I should update more frequently. Putting 'USE mod_nesting' before the function gives a different error. Removing the line allows the script to compile, but the model blows up when run, I assume because the donor grid contact points were not assigned correctly.

After modifying post_inital.F, I reinstalled ROMS and the test cases to confirm I still get the original error, and I do. I've attached my build script, which is the only file I've modified after reinstalling.

Thank you for your time.

-Ben
Attachments
build_roms.sh
(15.65 KiB) Downloaded 749 times

bhayward
Posts: 11
Joined: Thu Aug 31, 2023 3:51 pm
Location: University of Maine

Re: Nesting Issue at Compile

#2 Unread post by bhayward »

Hello,

I've gotten it working. The 'fix' was fairly clearly stated; I just had to define NestedGrids in the build script.

I don't know how old the version of ROMS I was using before is, but having CPP options in build script is new to me. I think I was looking to put the NestedGrids in the makefile or input file, which is what got me confused (since it is already in the input file). The input file doesn't get used for the compile though, so that not working does make sense to me.

For newer users who have this issue and stumble upon this thread...

In the build script you use (I use build_roms.sh) be sure to include the line:

Code: Select all

 export      NestedGrids 2
(edit: this doesn't work please read the rest of the post)
Last edited by bhayward on Wed May 28, 2025 1:59 pm, edited 1 time in total.

1594483558
Posts: 2
Joined: Fri Feb 28, 2025 1:49 pm
Location: shanghai ocean university

Re: Nesting Issue at Compile

#3 Unread post by 1594483558 »

I also encountered the same problem, but tried your method but it didn't work. Here are my .h file and build_roms.sh。
Attachments
build_roms.sh
(15.38 KiB) Downloaded 87 times
bohai_child.h
(2.32 KiB) Downloaded 87 times

bhayward
Posts: 11
Joined: Thu Aug 31, 2023 3:51 pm
Location: University of Maine

Re: Nesting Issue at Compile

#4 Unread post by bhayward »

Hello,

Sorry for the mistake; I typed it wrong. It should be

Code: Select all

export	NestedGrids=2
Let me know if that works.

Cheers!

-Ben

User avatar
arango
Site Admin
Posts: 1383
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Nesting Issue at Compile

#5 Unread post by arango »

The NestedGrids environmental variable was abandoned several years ago. We used to have it in ROMS versions 3.3 and 3.4. We used to have:

Code: Select all

        integer, parameter :: Ngrids = NestedGrids
This awkward strategy was abandoned, and the code was modified to use the value Ngrids provided in roms.in.

Code: Select all

!
!  Number of nested and/or connected grids to solve.
!
      integer :: Ngrids
I recently removed NestedGrids logic from the makefile.

Horror: If this value is needed in your code, you are using a version of ROMS that was released between 14 and 15 years ago. It is incomprehensible that you are using such an old version. ROMS has evolved and improved substantially over the last 15 years.

Please update the code!

1594483558
Posts: 2
Joined: Fri Feb 28, 2025 1:49 pm
Location: shanghai ocean university

Re: Nesting Issue at Compile

#6 Unread post by 1594483558 »

I have exported NestedGrids=2, but the error still occurs. I am using ROMS4.2 downloaded from GitHub.
I tried adding these two lines in post_initial.F

Code: Select all

      
      USE mod_nesting !Added on May 29, 2025
      USE nesting_mod,  ONLY :nesting !Added on May 29, 2025
 
This makes the compilation pass, but it is not known whether such a modification will have hidden dangers.

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

Re: Nesting Issue at Compile

#7 Unread post by robertson »

As Hernan mentioned, the NestedGrids environment variable should have no effect on compilation. If it does then you have some very old code.

I believe the issue you are having was addressed by a commit to the develop branch three weeks ago. You should always be using the latest develop branch and not tagged versions of ROMS. The tags are only meant as milestones and not true version releases. All improvements and bug fixes are found in the develop branch. This is why the develop branch is the default and what you will get if you follow the download instructions in both WikiROMS and on the GitHub page.

Please switch your source code back to the develop branch, do a git pull and try again:

Code: Select all

git checkout develop
git pull

bhayward
Posts: 11
Joined: Thu Aug 31, 2023 3:51 pm
Location: University of Maine

Re: Nesting Issue at Compile

#8 Unread post by bhayward »

Hello,

Thank you; I'm on the latest version of the develop branch now. I'm not exactly sure how I downloaded the tagged version that I did, since even the main branch seems to have been updated early this year. In the future I will be more careful and read the wiki.

Thank you for your time.

-Ben

Post Reply