Model time issue with SINGLE_PRECISION option

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
hbzong
Posts: 36
Joined: Thu Oct 04, 2007 4:14 am
Location: Fathom Science
Contact:

Model time issue with SINGLE_PRECISION option

#1 Unread post by hbzong »

Recently, I've been tuning an expensive model. To save time, I compiled the model with the SINGLE_PRECISION option. The initialization time of my simulation is 2/1/2021 12:00:00. After turning on SINGLE_PRECISION option, the time of the first step became 2/1/2021 12:01:04, which is 64 seconds ahead of the initial time. Once turn off the SINGLE_PRECISION option, it will go back to 2/1/2021 12:00:00.

Code: Select all

GET_STATE_NF90   - NLM: state initial conditions,                       2021-02-01 12:00:00.00

Code: Select all

 TIME-STEP YYYY-MM-DD hh:mm:ss.ss  KINETIC_ENRG   POTEN_ENRG    TOTAL_ENRG    NET_VOLUME
                      C => (i,j,k)       Cu            Cv            Cw         Max Speed
 
          0 2021-02-01 12:01:04.00  9.542633E-04  4.038722E+01  4.038817E+01  9.697605E+09
                      (149,0018,6)  6.014509E-03  2.628840E-02  0.000000E+00  1.250817E-01

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Model time issue with SINGLE_PRECISION option

#2 Unread post by arango »

Well, that is weird because when single precision is activated in ROMS, there are still several important variables that are declared in double precision, and time management is one of them. That is, ROMS is compiled in hybrid precision. You can check that easily by typing the following command at the top of the ROMS source code directory:

Code: Select all

> grep -r _dp *
You can check ROMS/Modules/mod_kinds.F for the definition of _dp. Make sure that your compiled rmod_kinds.f90 have that diction between _r8 and _dp.

Post Reply