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.
#2683 (File OCE/OBS/obs_fbm.F90 custom precision #mixedprecision) – NEMO

Opened 3 years ago

Last modified 2 years ago

#2683 assigned Request

File OCE/OBS/obs_fbm.F90 custom precision #mixedprecision

Reported by: sparonuz Owned by: systeam
Priority: low Milestone:
Component: OBS Version: v4.0.*
Severity: minor Keywords:
Cc:

Description

Context

In file File OCE/OBS/obs_fbm.F90 there are the following lines

   IMPLICIT NONE
   PUBLIC

   ! Type kinds for feedback data.

   INTEGER, PARAMETER :: fbsp = SELECTED_REAL_KIND( 6, 37) !: single precision
   INTEGER, PARAMETER :: fbdp = SELECTED_REAL_KIND(12,307) !: double precision

These are basically redefining the same precision (singe/double) already defined (publicly) in file OCE/par_kind.F90

   INTEGER, PUBLIC, PARAMETER ::   sp = SELECTED_REAL_KIND( 6, 37)   !: single precision (real 4)
   INTEGER, PUBLIC, PARAMETER ::   dp = SELECTED_REAL_KIND(12,307)   !: double precision (real 8)

If this was not made for a matter of flexibility, the definition should be removed and the global parameter should be used instead.

Proposal

I propose to add a

use par_kind

at the beginning of the file and change all the variables defined as

REAL(KIND=fbdp), DIMENSION [...] :: my_var1
REAL(KIND=fbsp), DIMENSION [...] :: my_var2

to

REAL(KIND=dp), DIMENSION [...] :: my_var1
REAL(KIND=sp), DIMENSION [...] :: my_var2

...

Commit History (1)

ChangesetAuthorTimeChangeLog
14932sparonuz2021-05-31T18:00:41+02:00

Removed custom precision, Ticket #2683

Change History (2)

comment:1 Changed 3 years ago by sparonuz

In 14932:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:2 Changed 2 years ago by nemo

  • Owner set to systeam
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.