# New URL for NEMO forge! http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#1301 (underflow in tra_qsr_init) – NEMO

Opened 10 years ago

Closed 10 years ago

# underflow in tra_qsr_init

Reported by: Owned by: cbricaud nemo low OCE v3.6

### 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 ?

(No commits)

### comment:1 Changed 10 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

END DO

END DO

END DO

### comment:2 Changed 10 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.