Test-case canyon2d

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
MoeinDst
Posts: 7
Joined: Tue Nov 22, 2022 5:31 pm
Location: University of Genoa
Contact:

Test-case canyon2d

#1 Unread post by MoeinDst »

Hello everyone.

I was trying to run the canyon test-cases in 2D and 3D and faced an error when trying to run in 2D.

Code: Select all

At line 1030 of file mod_ncparam.f90

Fortran runtime error: Index '1' of dimension 1 of array 'istvar' above upper bound of 0



Error termination. Backtrace:

#0  0x7f0dff3c7640 in ???

#1  0x7f0dff3c8185 in ???

#2  0x7f0dff3c852a in ???

#3  0x97da1a in __mod_ncparam_MOD_initialize_ncparam

	at /home/moein/myROMS/my_cases/mozambique_channel/mozambique2D/Build_romsG/mod_ncparam.f90:1030

#4  0x105f016 in read_phypar_

	at /home/moein/myROMS/my_cases/mozambique_channel/mozambique2D/Build_romsG/read_phypar.f90:224

#5  0x67a8db in __inp_par_mod_MOD_inp_par

	at /home/moein/myROMS/my_cases/mozambique_channel/mozambique2D/Build_romsG/inp_par.f90:84

#6  0x40722e in __roms_kernel_mod_MOD_roms_initialize

	at /home/moein/myROMS/my_cases/mozambique_channel/mozambique2D/Build_romsG/roms_kernel.f90:86

#7  0x408770 in myroms

	at /home/moein/myROMS/my_cases/mozambique_channel/mozambique2D/Build_romsG/master.f90:75

#8  0x408dac in main

	at /home/moein/myROMS/my_cases/mozambique_channel/mozambique2D/Build_romsG/master.f90:50
and this is the part in mod_ncparam.f90:

Code: Select all

!                                                                               
      isBp2d=isFsur                          ! 2D PSI-variables                
      isBr2d=isFsur                           ! 2D RHO-variables                
      isBu2d=isUbar                         ! 2D U-variables                  
      isBv2d=isVbar                          ! 2D V-variables                  
      isBp3d=isTvar(1)                      ! 3D PSI-variables                
      isBr3d=isTvar(1)                       ! 3D RHO-variables                
      isBu3d=isUvel                          ! 3D U-variables                  
      isBv3d=isVvel                           ! 3D V-variables                  
      isBw3d=isTvar(1)                      ! 3D W-variables                  
!
However, by defining SOLVE3D and putting vertical levels, I can run it in 3D. Moreover, I have the same issue with my own set-up for my study area that I cannot run it in 2D.
I would truly appreciate it if you could help me in this regard.

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

Re: Test-case canyon2d

#2 Unread post by arango »

For the 2D test case, you need to undefine SOLV3D. Check ROMS test repository :arrow: https://www.myroms.org/svn/src/test.

MoeinDst
Posts: 7
Joined: Tue Nov 22, 2022 5:31 pm
Location: University of Genoa
Contact:

Re: Test-case canyon2d

#3 Unread post by MoeinDst »

arango wrote: Sun Apr 02, 2023 3:57 pm For the 2D test case, you need to undefine SOLV3D. Check ROMS test repository :arrow: https://www.myroms.org/svn/src/test.
That's exactly what I did that received the error I mentioned above. When I undef SOLVE3D, it shows the error regarding istvar being out of bound 0.

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

Re: Test-case canyon2d

#4 Unread post by arango »

Okay, I will check it out later. I think that in mod_ncparam.F, we need to have instead:

Code: Select all

!
!  Set generic lateral boundary indices for LBC structure.  Use the same
!  values of the state variables at the same C-grid location.  Generic
!  indices are used for testing periodicity.  The PSI-variables and
!  W-variables are assigned the same value as the RHO-variables.
!
      isBp2d=isFsur                           ! 2D PSI-variables
      isBr2d=isFsur                           ! 2D RHO-variables
      isBu2d=isUbar                           ! 2D U-variables
      isBv2d=isVbar                           ! 2D V-variables
#if defined SOLVE3D
      isBp3d=isTvar(1)                        ! 3D PSI-variables
      isBr3d=isTvar(1)                        ! 3D RHO-variables
      isBu3d=isUvel                           ! 3D U-variables
      isBv3d=isVvel                           ! 3D V-variables
      isBw3d=isTvar(1)                        ! 3D W-variables
# if defined GLS_MIXING || defined MY25_MIXING
      isMtke=isTvar(MT)+1                     ! turbulent variables
# endif
#endif

MoeinDst
Posts: 7
Joined: Tue Nov 22, 2022 5:31 pm
Location: University of Genoa
Contact:

Re: Test-case canyon2d

#5 Unread post by MoeinDst »

arango wrote: Mon Apr 03, 2023 12:52 pm Okay, I will check it out later. I think that in mod_ncparam.F, we need to have instead:

Code: Select all

!
!  Set generic lateral boundary indices for LBC structure.  Use the same
!  values of the state variables at the same C-grid location.  Generic
!  indices are used for testing periodicity.  The PSI-variables and
!  W-variables are assigned the same value as the RHO-variables.
!
      isBp2d=isFsur                           ! 2D PSI-variables
      isBr2d=isFsur                           ! 2D RHO-variables
      isBu2d=isUbar                           ! 2D U-variables
      isBv2d=isVbar                           ! 2D V-variables
#if defined SOLVE3D
      isBp3d=isTvar(1)                        ! 3D PSI-variables
      isBr3d=isTvar(1)                        ! 3D RHO-variables
      isBu3d=isUvel                           ! 3D U-variables
      isBv3d=isVvel                           ! 3D V-variables
      isBw3d=isTvar(1)                        ! 3D W-variables
# if defined GLS_MIXING || defined MY25_MIXING
      isMtke=isTvar(MT)+1                     ! turbulent variables
# endif
#endif
I would really appreciate it. In all configurations, this part is always like this in my mod_ncparam.f90 under Build_roms(G) directory, and of course without the #if defined part. if I use GLS_MIXING, the last part (isMtke) also appears. Otherwise if I use ana_vmix for instance, it's same as mentioned above.

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

Re: Test-case canyon2d

#6 Unread post by arango »

Nope, if SOLVE3D is undefined, you are solving the vertically integrated shallow-water equations. There are no vertical levels in such an application. Neither vertical mixing parameterization like GLS_MIXING or others. The state variables are only zeta, ubar, and vbar.

I updated the repositories. See the following :arrow: trac ticket.

MoeinDst
Posts: 7
Joined: Tue Nov 22, 2022 5:31 pm
Location: University of Genoa
Contact:

Re: Test-case canyon2d

#7 Unread post by MoeinDst »

arango wrote: Mon Apr 03, 2023 9:24 pm Nope, if SOLVE3D is undefined, you are solving the vertically integrated shallow-water equations. There are no vertical levels in such an application. Neither vertical mixing parameterization like GLS_MIXING or others. The state variables are only zeta, ubar, and vbar.

I updated the repositories. See the following :arrow: trac ticket.
Thanks for your time and consideration. However, there is still a problem with the mod_ncparam.f90. After updating the source, now there is the problem with idTvar being out of bound 0 :

Code: Select all

At line 1192 of file mod_ncparam.f90

Fortran runtime error: Index '1' of dimension 1 of array 'idtvar' above upper bound of 0

Error termination. Backtrace:

#0  0x7f756e746640 in ???

#1  0x7f756e747185 in ???

#2  0x7f756e74752a in ???

#3  0x964fc1 in __mod_ncparam_MOD_initialize_ncparam

	at /my_cases/CANYON/Build_romsG/mod_ncparam.f90:1192

#4  0xec73ba in read_phypar_

	at /my_cases/CANYON/Build_romsG/read_phypar.f90:224

#5  0x693264 in __inp_par_mod_MOD_inp_par

	at /my_cases/CANYON/Build_romsG/inp_par.f90:84

#6  0x4072de in __roms_kernel_mod_MOD_roms_initialize

	at /my_cases/CANYON/Build_romsG/roms_kernel.f90:86

#7  0x408820 in myroms

	at /my_cases/CANYON/Build_romsG/master.f90:75

#8  0x408e5c in main

	at /my_cases/CANYON/Build_romsG/master.f90:50

Post Reply