Opened 9 years ago

Closed 9 years ago

#679 closed bug (Fixed)

IMPORTANT: correction to mod_grid.F in nesting applications

Reported by: arango Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.7
Component: Nonlinear Version: 3.7
Keywords: Cc:

Description

In nested applications, all the model arrays are made larger to include the additional contact points in the contact areas. See the following forum post for details (top figure showing contact areas and contact points).

In nesting applications, all the metrics arrays are initialized to spval, which is a very large value. This is very important since it is the only mechanism that we have to check if all the values for the metric arrays were fill correctly at the contact points. Their values are computed in the Matlab script contact.m. They are read in ROMS from input NGCNAME NetCDF file.

In routine metrics.F, we call subroutine fill_contact and use the spval_check to check if all the contact points values where properly assigned. If not, it will stop computations and issue an appropriate error message. There is no other way in the current nesting design to check for this. This is extremely important!

However in routine initialize_grid of module mod_grid.F, we have the following statements:

!
!  Set initialization value that it is special in nexting to just
!  load contact points that have not been initialized from the
!  regular physical grid. This is done to make sure that all these
!  important metric values have been set-up correctly.
!
#ifdef NESTING
      IniMetricVal=spval                   ! very large value
      IniMetricVal=IniVal
#else
      IniMetricVal=IniVal
#endif

Obviously, this is typo since IniMetricVal is still zero in nesting applications. I don't know were the second reassignment comes from. It should not affected any nested application but it is a good idea to have this safeguard in case that an user changes the input contact NetCDF file. We need to have instead:

#ifdef NESTING
      IniMetricVal=spval                   ! very large value
#else
      IniMetricVal=IniVal
#endif

Many thanks to Tarandeep Kalra and John Warner for bringing this to my attention.

Change History (1)

comment:1 by arango, 9 years ago

Resolution: Fixed
Status: newclosed
Note: See TracTickets for help on using tickets.