[MITgcm-support] Segmentation fault too...
Riema Rachmayani
imoth_22 at yahoo.com
Mon Mar 12 05:44:09 EDT 2007
hi...
My killed problem was over
thank you Patrick!!!..
but I have new problem
now, I have 4 open boundaries, north, south, east, and west , so I modify obcs_calc.F for them. And then I have error message segmentation fault. But if I try for 2 open boundaries, its work!!! There is no error message
whats wrong with my modify?? Or other factor influence the error??
thank you,
-rima-
here is my new configuration :
In data.obcs
# Open-boundaries
&OBCS_PARM01
OB_Jnorth=-1,
OB_Jsouth=1,
OB_Ieast=-1,
OB_Iwest=1,
&
In obcs_calc.F
C $Header: /u/gcmpack/MITgcm/verification/internal_wave/code/obcs_calc.F,v 1.5 2002/08/07 16:55:52 mlosch Exp $
C $Name: $
#include "OBCS_OPTIONS.h"
SUBROUTINE OBCS_CALC( bi, bj, futureTime, futureIter,
& uVel, vVel, wVel, theta, salt,
& myThid )
C /==========================================================\
C | SUBROUTINE OBCS_CALC |
C | o Calculate future boundary data at open boundaries |
C | at time = futureTime |
C |==========================================================|
C | |
C \==========================================================/
IMPLICIT NONE
C === Global variables ===
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "EOS.h"
#include "OBCS.h"
C == Routine arguments ==
INTEGER bi, bj
INTEGER futureIter
_RL futureTime
_RL uVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL vVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL uFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL wVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL theta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL salt (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL etaN (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
_RS Hfld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
_RL gU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL gV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL etaFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
INTEGER myThid
#ifdef ALLOW_OBCS
C == Local variables ==
INTEGER I, J ,K,I_obc,j_obc
#include "GRID.h"
_RL obTimeScale,Uinflow,rampTime2
_RL mz,strat,kx,rkec1,rkec2,rkec3,rkec4,rk,rlong,romega
_RL tmpsumW,CL,rkE,rkN,rkS,rkW
_RL tmpsumE
C Vertical mode number
mz=1.0 _d 0
C Stratification
strat = 1.0 _d -6 / (gravity*tAlpha)
obTimeScale = 44640.0 _d 0
romega=2.0*pi/obTimeScale
C *NOTE* I have commented out the ramp function below
C just to speed things up. You will probably want to use it
C for smoother looking solutions.
rampTime2 = 4. _d 0*44640.0 _d 0
C Eastern OB
DO J=1-Oly,sNy+Oly
C Elevation
if ((j.ge.183).and.(j.le.255))then
OBEeta(j,bi,bj)=0.17*cos(romega*futureTime
& -(0.0*(2.*pi/360.)))
else if ((j.ge.1).and.(j.le.111))then
OBEeta(J,bi,bj)=rkE*etaN(I_obc-2,J,bi,bj)+
& (1.0-rkE)*etaN(I_obc-1,J,bi,bj)
endif
ENDDO
CC zonal and meridional velocity, temp, salt
IF (useOrlanskiEast) THEN
CALL ORLANSKI_EAST(
& bi, bj, futureTime,
& uVel, vVel, wVel,theta, salt,
& myThid )
ELSE
DO K=1,Nr
DO J=1-Oly,sNy+Oly
I_obc=OB_Ie(J,bi,bj)
IF (I_obc.ne.0) THEN
rkec1=sqrt(gravity*-1*HFld(Nx-1,j,bi,bj))
rkE=(deltaT*rkec1)/1000.0
cc ------gradient-----
OBEv(J,K,bi,bj)=vVel(i_obc-1,J,K,bi,bj)
CC -------radiation condition for T------(26feb'07)
OBEt(J,K,bi,bj)=rkE*theta(I_obc-1,J,K,bi,bj)+
& (1.0-rkE)*theta(I_obc,J,K,bi,bj)
CC ------- radiation condition for S------(26feb'07)
OBEs(J,K,bi,bj)=rkE*salt(I_obc-1,J,K,bi,bj)+
& (1.0-rkE)*salt(I_obc,J,K,bi,bj)
#ifdef ALLOW_NONHYDROSTATIC
CC ------- radiation condition for W------(26feb'07)
OBEw(J,K,bi,bj)=rkE*wVel(I_obc-1,J,K,bi,bj)+
& (1.0-rkE)*wVel(I_obc,J,K,bi,bj)
#endif
#ifdef NONLIN_FRSURF
#endif
ENDIF
ENDDO
ENDDO
ENDIF
C Western OB
DO J=1-Oly,sNy+Oly
C Elevation
if ((j.ge.1).and.(j.le.118)) then
OBWeta(j,bi,bj)=0.1*cos(romega*futureTime
& -(174.0*(2.*pi/360.)))
else if((j.ge.200).and.(j.le.255)) then
I_obc=OB_Iw(J,bi,bj)
IF (I_obc.ne.0) THEN
rkec2=sqrt(gravity*-1*HFld(2,j,bi,bj))
rkW=(deltaT*rkec2)/1000.0
OBWeta(J,bi,bj)=rkW*etaN(I_obc+2,J,bi,bj)+
& (1.0-rkW)*etaN(I_obc+1,J,bi,bj)
endif
ENDDO
CC zonal and meridional velocity, temp, salt
IF (useOrlanskiWest) THEN
CALL ORLANSKI_WEST(
& bi, bj, futureTime,
& uVel, vVel, wVel, theta, salt,
& myThid )
ELSE
DO K=1,Nr
DO J=1-Oly,sNy+Oly
I_obc=OB_Iw(J,bi,bj)
IF (I_obc.ne.0) THEN
rkec2=sqrt(gravity*-1*HFld(2,j,bi,bj))
rkW=(deltaT*rkec2)/1000.0
cc ====gradient for V===
OBWv(J,K,bi,bj)=vVel(i_obc+1,J,K,bi,bj)
CC ------- radiation condition for T ------(26feb'07)
OBWt(J,K,bi,bj)=rkW*theta(I_obc+2,J,K,bi,bj)+
& (1.0-rkW)*theta(I_obc+1,J,K,bi,bj)
CC ------- radiation condition for S ------(26feb'07)
OBWs(J,K,bi,bj)=rkW*salt(I_obc+2,J,K,bi,bj)+
& (1.0-rkW)*salt(I_obc+1,J,K,bi,bj)
#ifdef ALLOW_NONHYDROSTATIC
CC ------- radiation condition for W ------(26feb'07)
OBWw(J,K,bi,bj)=rkW*wVel(I_obc+2,J,K,bi,bj)+
& (1.0-rkW)*wVel(I_obc+1,J,K,bi,bj)
#endif
#ifdef NONLIN_FRSURF
#endif
ENDIF
ENDDO
ENDDO
ENDIF
C Northern OB
CC Elevation
DO I=1-Olx,sNx+Olx
J_obc=OB_Jn(I,bi,bj)
IF (J_obc.ne.0) THEN
rkec3=sqrt(gravity*-1*HFld(i,Ny-1,bi,bj))
rkN=(deltaT*rkec3)/1000.0
OBNeta(I,bi,bj)=rkN*etaN(I,J_obc-2,bi,bj)+
& (1.0-rkN)*etaN(I,J_obc-1,bi,bj)
ENDIF
ENDDO
CC zonal and meridional velocity, temp, salt
IF (useOrlanskiNorth) THEN
CALL ORLANSKI_NORTH(
& bi, bj, futureIter,
& uVel, vVel, wVel, theta, salt,
& myThid )
ELSE
DO K=1,Nr
DO I=1-Olx,sNx+Olx
rkec3=sqrt(gravity*-1*HFld(i,Ny,bi,bj))
rkN=(deltaT*rkec3)/1000.0
CC ------- radiation condition for U ------(26feb'07)
OBNu(I,K,bi,bj)=uVel(i,j_obc-1,K,bi,bj)
CC ------- radiation condition for V ------(26feb'07)
OBNv(I,K,bi,bj)=rkN*vVel(I,J_obc-1,K,bi,bj)+
& (1.0-rkN)*vVel(I,J_obc,K,bi,bj)
CC ------- radiation condition for W ------(26feb'07)
OBNt(I,K,bi,bj)=rkN*theta(I,J_obc-1,K,bi,bj)+
& (1.0-rkN)*theta(I,J_obc,K,bi,bj)
CC ------- radiation condition for S ------(26feb'07)
OBNs(I,K,bi,bj)=rkN*salt(I,J_obc-1,K,bi,bj)+
& (1.0-rkN)*salt(I,J_obc,K,bi,bj)
#ifdef ALLOW_NONHYDROSTATIC
CC ------- radiation condition for W ------(26feb'07)
OBNw(I,K,bi,bj)=rkN*wVel(I,J_obc-1,K,bi,bj)+
& (1.0-rkN)*wVel(I,J_obc,K,bi,bj)
#endif
ENDDO
ENDDO
ENDIF
C Southern OB
CC Elevation
DO I=1-Olx,sNx+Olx
J_obc=OB_Jn(I,bi,bj)
IF (J_obc.ne.0) THEN
rkec4=sqrt(gravity*-1* HFld(i,2,bi,bj))
rkS=(deltaT*rkec4)/1000.0
OBSeta(I,bi,bj)=rkS*etaN(I,J_obc+2,bi,bj)+
& (1.0-rkS)*etaN(I,J_obc+1,bi,bj)
ENDDO
CC zonal and meridional velocity, temp, salt
IF (useOrlanskiSouth) THEN
CALL ORLANSKI_SOUTH(
& bi, bj, futureIter,
& uVel, vVel, wVel, theta, salt,
& myThid )
ELSE
DO K=1,Nr
DO I=1-Olx,sNx+Olx
rkec4=sqrt(gravity*-1* HFld(i,2,bi,bj))
rkS=(deltaT*rkec4)/1000.0
CC ------- radiation condition for U ------(26feb'07)
OBSu(I,K,bi,bj)=rkS*uVel(I,J_obc+2,K,bi,bj)+
& (1.0-rkS)*uVel(I,J_obc+1,K,bi,bj)
CC ------- radiation condition for V ------(26feb'07)
OBSv(J,K,bi,bj)=vVel(i,j_obc+1,K,bi,bj)-(deltaT
OBSv(I,K,bi,bj)=rkS*vVel(I,J_obc+2,K,bi,bj)+
& (1.0-rkS)*vVel(I,J_obc+1,K,bi,bj)
CC ------- radiation condition for T ------(26feb'07)
OBSt(I,K,bi,bj)=rkS*theta(I,J_obc+2,K,bi,bj)+
& (1.0-rkS)*theta(I,J_obc+1,K,bi,bj)
CC ------- radiation condition for S ------(26feb'07)
OBSs(I,K,bi,bj)=rkS*salt(I,J_obc+2,K,bi,bj)+
& (1.0-rkS)*salt(I,J_obc+1,K,bi,bj)
#ifdef ALLOW_NONHYDROSTATIC
CC ------- radiation condition for W------(26feb'07)
OBSw(I,K,bi,bj)=rkS*wVel(I,J_obc+2,K,bi,bj)+
& (1.0-rkS)*wVel(I,J_obc+1,K,bi,bj)
#endif
ENDDO
ENDDO
ENDIF
#endif /* ALLOW_OBCS */
RETURN
END
Send instant messages to your online friends http://uk.messenger.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20070312/10ff2697/attachment.htm>
More information about the MITgcm-support
mailing list