[MITgcm-support] Problem with MNC initialization
Baylor Fox-Kemper
baylor at MIT.EDU
Mon Oct 11 13:13:55 EDT 2004
Hello,
I'm having a problem with the most recent cvs update with mnc. When
the model initializes, I get a seg fault. I am using g77 on Mac OSX.
The debugging info is:
When the original 'state' file is written in ini_model_io:
C Write coordinates to "state" file
CALL MNC_CW_SET_UDIM('state', 0, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'XC',xC, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'YC',yC, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'XU',xG, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'YU',yC, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'XV',xC, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'YV',yG, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'XG',xG, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'YG',yG, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'RC',rC, myThid)
CALL MNC_CW_RS_W('R','state',0,0,'RF',rF, myThid)
The mnc_cw_rs_w dies when it calls:
var_arr(1) = var
CALL MNC_CW_RS_W_OFFSET(stype,fbname,bi,bj,vtype, var_arr,
& offsets, myThid)
Ultimately, this stems from a call inside this routine indicated with
the arrow:
IF (stype(1:1) .EQ. 'R') THEN
DO j1 = s(1),e(1)
k1 = k2 + j1
kr = kr + 1
==> resh_r(kr) = var(k1)
ENDDO
In my particular run, this crashes when k1=247, but I'm sure that's
setup specific.
Since var is this subroutine's version of var_arr, and var_arr in this
instance is xc, which is an 80x30=2400 array, I am puzzled why this
crashes before k1=2400.
Running with -fbounds-check doesn't seem to improve the problem...
Thanks,
-Baylor
More information about the MITgcm-support
mailing list