Opened 7 years ago

Closed 6 years ago

#1301 closed Bug (fixed)

underflow in tra_qsr_init

Reported by: cbricaud Owned by: nemo
Priority: low Milestone:
Component: OCE Version: release-3.6
Severity: Keywords:
Cc:

Description

2 lines give underflow ( due to EXP ):

zc0 = zz0 * EXP( -fsdepw(ji,jj,jk )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk )*xsi1r )
zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r )

proposition of fix:
zc0 = zz0 * EXP( MAX( -fsdepw(ji,jj,jk )*xsi0r ,-1.e-4 ) ) +

zz1 * EXP( MAX(-fsdepw(ji,jj,jk )*xsi1r ,-1.e-4 ) )

zc1 = zz0 * EXP( MAX( -fsdepw(ji,jj,jk+1)*xsi0r ,-1.e-4 ) ) +

zz1 * EXP( MAX(-fsdepw(ji,jj,jk+1)*xsi1r,-1.e-4 ) )

someone have a better idea ?

Commit History (0)

(No commits)

Change History (2)

comment:1 Changed 6 years ago by cbricaud

the previous proposition was not good.
This one should be better :

zz0 = rn_abs * r1_rau0_rcp
zz1 = ( 1. - rn_abs ) * r1_rau0_rcp
DO jk = 1, nksr !* solar heat absorbed at T-point computed once for all

DO jj = 1, jpj ! top 400 meters

DO ji = 1, jpi

IF( fsdepw(ji,jj,jk )*xsi0r .LE. 1.e3 .AND. fsdepw(ji,jj,jk )*xsi1r .LE. 1.e3 )THEN

zc0 = zz0 * EXP( -fsdepw(ji,jj,jk )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk )*xsi1r )
zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r )

ELSE

zc0=0.
zc1=0.

ENDIF
etot3(ji,jj,jk) = ( zc0 * tmask(ji,jj,jk) - zc1 * tmask(ji,jj,jk+1) )

END DO

END DO

END DO

comment:2 Changed 6 years ago by cbricaud

  • Resolution set to fixed
  • Status changed from new to closed

no need to change something. it was just a problem of compilation option with xlf compiler.

Note: See TracTickets for help on using tickets.