I'm new in trying ROMS. I installed it in a Linux machine that I'm running remotly from a windows computer through putty. The upwellingg test case runs good.
Now I'm trying to run the https://www.myroms.org/wiki/FJORD_TIDAL_CASE , when compiling, in both cases I get this error:
Error: 'rdrag2' at (1) is not a member of the 't_grid' structure
make: *** [/u2/hydro/ROMS/MyTest/fjord/Build/wrt_info.o] Error 1
I can't find any answers online. What does it mean? How I can solve this?
Fjord tidal test case
Re: Fjord tidal test case
The way I hunt down this sort of thing:
You need to #define UV_QDRAG and not define UV_LDRAG.
So we look at mod_grid.F:chinook03 203% grep rdrag2 */Modules/*
ROMS/Modules/mod_grid.F:! rdrag2 Quadratic drag coefficient (nondimensional). !
ROMS/Modules/mod_grid.F: real(r8), pointer :: rdrag2(:,:)
ROMS/Modules/mod_grid.F: allocate ( GRID(ng) % rdrag2(LBi:UBi,LBj:UBj) )
ROMS/Modules/mod_grid.F: GRID(ng) % rdrag2(i,j) = rdrg2(ng)
Code: Select all
#if defined UV_LDRAG
GRID(ng) % rdrag(i,j) = rdrg(ng)
#elif defined UV_QDRAG
GRID(ng) % rdrag2(i,j) = rdrg2(ng)
#endif
Re: Fjord tidal test case
Thanks for the reply
So in my fjord.h I have #define UV_QDRAG /* use to turn ON or OFF quadratic bottom friction */
and in my mod_grid.F I have this
#if defined UV_LDRAG
GRID(ng) % rdrag(i,j) = rdrg(ng)
#elif defined UV_QDRAG
GRID(ng) % rdrag2(i,j) = rdrg2(ng)
which looks like yours but still doesn't run.
So in my fjord.h I have #define UV_QDRAG /* use to turn ON or OFF quadratic bottom friction */
and in my mod_grid.F I have this
#if defined UV_LDRAG
GRID(ng) % rdrag(i,j) = rdrg(ng)
#elif defined UV_QDRAG
GRID(ng) % rdrag2(i,j) = rdrg2(ng)
which looks like yours but still doesn't run.
Re: Fjord tidal test case
Next is to look in $SCRATCH_DIR/mod_grid.f90 to see what's in there. That's the result of the C-preprocessor.
Re: Fjord tidal test case
Hi Kate, many thanks. What shall I seek in here? I only see rdrag instead of rdrag2 but I'm not sure if it is that.... I'm attaching it
- Attachments
-
- mod_grid.f90
- (22.75 KiB) Downloaded 331 times
Re: Fjord tidal test case
You say
First, be very careful about spelling of #define directives. Are you sure you have all the right characters (I'm sure you do, for some directives 0 and o or 1 and l can be confused.
Second, be careful about the placement of comments (the /* and */ syntax in C.) A language sensitive editor will highlight fields in your fjord.h to distinguish these. If you haven't closed a comment correctly (line breaks are of no consequence) something may be disabled.
Next, did ROMS run at all? If it did it should have reported the CPP options to the logfile. Look for the drag option there and make sure it's what you intended. If it created a netcdf output file they are reported there too in the global attributes. It's important to know what ROMS was actually told, as opposed to what you think you told it to do.
Did you modify mod_grid.h? I hope not. If you did, check for missing #endif.
That fjord test case is not one of the ones we support in the trunk distribution of the code, and that page in the wiki has not been updated since 2008. For example, the code chunks to modify ana_m2obs.h etc. are quite out of date in how they specify open boundary code. Perhaps you have adapted to those changes, but be careful to work within the new framework. But I doubt that would have thrown errors in mod_grid.f90, so this remains a mystery.
The fjord_grd.nc has "spherical" as a char T/F, when now ROMS expects a logical 0/1. But again, I doubt that would have thrown errors in mod_grid.f90.
There are a few things to check here.I only see rdrag instead of rdrag2
First, be very careful about spelling of #define directives. Are you sure you have all the right characters (I'm sure you do, for some directives 0 and o or 1 and l can be confused.
Second, be careful about the placement of comments (the /* and */ syntax in C.) A language sensitive editor will highlight fields in your fjord.h to distinguish these. If you haven't closed a comment correctly (line breaks are of no consequence) something may be disabled.
Next, did ROMS run at all? If it did it should have reported the CPP options to the logfile. Look for the drag option there and make sure it's what you intended. If it created a netcdf output file they are reported there too in the global attributes. It's important to know what ROMS was actually told, as opposed to what you think you told it to do.
Did you modify mod_grid.h? I hope not. If you did, check for missing #endif.
That fjord test case is not one of the ones we support in the trunk distribution of the code, and that page in the wiki has not been updated since 2008. For example, the code chunks to modify ana_m2obs.h etc. are quite out of date in how they specify open boundary code. Perhaps you have adapted to those changes, but be careful to work within the new framework. But I doubt that would have thrown errors in mod_grid.f90, so this remains a mystery.
The fjord_grd.nc has "spherical" as a char T/F, when now ROMS expects a logical 0/1. But again, I doubt that would have thrown errors in mod_grid.f90.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
Re: Fjord tidal test case
Hi Wilkin, thanks for all of these comments.
I'm trying to use the jord test case because I'm going to be using ROMS for some Fiords in Iceland. So in parallel I was carrying the same steps for one of my fiords to learn about ROMS (this is my first attempt with a model and it's language). Maybe I should try another test case, one updated...
Let me answer to each of your comments:
- My ROMS runs for the upwelling case (generates OceanS, OceanM, OceanG and OceanO without problems, depending on the settings). In contrast, for the Fiord case it generates the build folder and is able to run only for a bit.
- I did not modified the mod_grid.h, only the ana_fsobc.h and the ana_m2obc.h
- I did not updated the chuck of data needed for the ana_m2obs.h maybe I should start there...
- about other codding stuff, I just followed the steps on the website.
I'm in my very first ROMS steps and working alone, so any comments, must read/do suggestions are welcome!!
Thanks for your help
I'm trying to use the jord test case because I'm going to be using ROMS for some Fiords in Iceland. So in parallel I was carrying the same steps for one of my fiords to learn about ROMS (this is my first attempt with a model and it's language). Maybe I should try another test case, one updated...
Let me answer to each of your comments:
- My ROMS runs for the upwelling case (generates OceanS, OceanM, OceanG and OceanO without problems, depending on the settings). In contrast, for the Fiord case it generates the build folder and is able to run only for a bit.
- I did not modified the mod_grid.h, only the ana_fsobc.h and the ana_m2obc.h
- I did not updated the chuck of data needed for the ana_m2obs.h maybe I should start there...
- about other codding stuff, I just followed the steps on the website.
I'm in my very first ROMS steps and working alone, so any comments, must read/do suggestions are welcome!!
Thanks for your help