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.
#406 (optimize sbcssr.F90 routine) – NEMO

Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#406 closed Enhancement (fixed)

optimize sbcssr.F90 routine

Reported by: rbourdal Owned by: nemo
Priority: low Milestone:
Component: OCE Version:
Severity: Keywords:
Cc:

Description

Bad place for the operation "zsrp = deds / rday"
in sbcssr.F90 :

IF( nn_sssr == 1 ) THEN ! Salinity damping term (salt flux, emps only)
!CDIR COLLAPSE

! use zerp scalar to optimize memory access (speedup the loop)

DO jj = 1, jpj

DO ji = 1, jpi

zsrp = deds / rday ! from [mm/day] to [kg/m2/s]

zerp = zsrp * ( 1. - 2.*rnfmsk(ji,jj) ) & ! No damping in vicinity of river mouths

& * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) ) &
& / ( sss_m(ji,jj) + 1.e-20 )

emps(ji,jj) = emps(ji,jj) + zerp
erp( ji,jj) = zerp

END DO

END DO

ELSEIF( nn_sssr == 2 ) THEN ! Salinity damping term (volume flux, emp and emps)

!CDIR COLLAPSE

! use zerp scalar to optimize memory access (speedup the loop)

DO jj = 1, jpj

DO ji = 1, jpi

zsrp = deds / rday ! from [mm/day] to [kg/m2/s]

zerp = zsrp * ( 1. - 2.*rnfmsk(ji,jj) ) & ! No damping in vicinity of river mouths

& * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) ) &
& / ( sss_m(ji,jj) + 1.e-20 )

emp (ji,jj) = emp (ji,jj) + zerp
emps(ji,jj) = emps(ji,jj) + zerp
erp (ji,jj) = zerp

END DO

END DO

ENDIF
!

ENDIF
!

ENDIF

Commit History (2)

ChangesetAuthorTimeChangeLog
1524ctlod2009-07-22T14:04:35+02:00

style changes only, see ticket: #406

1494ctlod2009-07-20T11:27:56+02:00

move the computation of zsrp=deds/rday term out of a loop, see ticket: #406

Change History (2)

comment:1 Changed 15 years ago by ctlod

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

comment:2 Changed 6 years ago by marc

In 10020:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found
Note: See TracTickets for help on using tickets.