Model running error: REASON: KEchar = NaN, PEchar = NaN

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
zhaolv
Posts: 39
Joined: Thu Nov 11, 2021 3:56 pm
Location: Changsha University of Science and Technology

Model running error: REASON: KEchar = NaN, PEchar = NaN

#1 Unread post by zhaolv »

I am using coawst to study recently, but I got an error when I tried to run the roms model alone. I think there should be no problem with my initial file data. Maybe my ocean.in file parameters are wrong?

Code: Select all

    
    GET_3DFLD   - salinity climatology,                            2018-09-16 00:00:00.00
                   (Grid=02, Rec=2, Index=2, File: Mangkhut_clm_ref3.nc)
                   (Tmin=      58376.0000 Tmax=      58378.0000)      t =      58377.0000
                   (Min =  2.54292011E+01 Max =  3.57938309E+01)
         0 2018-09-15 00:00:00.00           NaN           NaN           NaN           NaN  02
                     (191,101,16)  4.151879E-03  3.534937E-03  0.000000E+00  1.287490E+00
 Found Error: 01   Line: 341      Source: ROMS/Nonlinear/main3d.F
 Found Error: 01   Line: 331      Source: ROMS/Drivers/nl_ocean.h, ROMS_run

 Blowing-up: Saving latest model state into  RESTART file
     REASON: KEchar =      NaN, PEchar =      NaN

      WRT_RST     - wrote re-start    fields (Index=1,1) in record = 1                     01
      
I checked the main3d.F and nl_ocean.h files. The corresponding part of the code is as follows:

main3d.F Line: 341

Code: Select all

!-----------------------------------------------------------------------
!  Compute horizontal mass fluxes (Hz*u/n and Hz*v/m), density related
!  quatities and report global diagnostics.
!-----------------------------------------------------------------------
!
            DO ig=1,GridsInLayer(nl)
              ng=GridNumber(ig,nl)
              DO tile=first_tile(ng),last_tile(ng),+1
                CALL set_massflux (ng, tile, iNLM)
# ifndef TS_FIXED
                CALL rho_eos (ng, tile, iNLM)
# endif
                CALL diag (ng, tile)
# ifdef TLM_CHECK
                CALL nl_dotproduct (ng, tile, Lnew(ng))
# endif
              END DO
!$OMP BARRIER
            END DO
            IF (FoundError(exit_flag, NoError, __LINE__, MyFile)) RETURN

# if defined ROMS_COUPLING && defined MCT_LIB
nl_ocean.h Line: 331

Code: Select all

!-----------------------------------------------------------------------
!  Time-step nonlinear model over nested grids, if applicable.
#if defined MODEL_COUPLING && !defined MCT_LIB
!  Since the ROMS kernel has a delayed output and line diagnostics by
!  one timestep, subtact an extra value to the report of starting and
!  ending timestep for clarity. Usually, the model coupling interval
!  is of the same size as ROMS timestep.
#endif
!-----------------------------------------------------------------------
!
      MyRunInterval=RunInterval
      IF (Master) WRITE (stdout,'(1x)')
      DO ng=1,Ngrids
#if defined MODEL_COUPLING && !defined MCT_LIB
        NEXTtime=time(ng)+RunInterval
        ENDtime=INItime(ng)+(ntimes(ng)-1)*dt(ng)
        IF ((NEXTtime.eq.ENDtime).and.(ng.eq.1)) THEN
          extra=0                                   ! last time interval
        ELSE
          extra=1
        END IF
        step_counter(ng)=0
        NstrStep=iic(ng)
        NendStep=NstrStep+INT((MyRunInterval)/dt(ng))-extra
        IF (Master) WRITE (stdout,10) 'NL', ng, NstrStep, NendStep
#else
        IF (Master) WRITE (stdout,10) 'NL', ng, ntstart(ng), ntend(ng)
#endif
      END DO
      IF (Master) WRITE (stdout,'(1x)')
!
!$OMP PARALLEL
#ifdef SOLVE3D
      CALL main3d (MyRunInterval)
#else
      CALL main2d (MyRunInterval)
#endif
#ifdef INWAVE_MODEL
!     CALL inwave_run
#endif
!$OMP END PARALLEL

      IF (FoundError(exit_flag, NoError, __LINE__, MyFile)) RETURN
      
I initially thought that there was a problem with my .bdy and forcing files, but after checking it, I found that the data was normal. Only the ocean_time and other parameters in the bdy and clm files are different from those in the ini file. I unified them to 58376 (otherwise other errors will occur).
But I still get the error.I have attached the log file in the end.
I do have no idea about this, Can anyone give me some suggestions or ideas?
thank you very much.
Attachments
roms.log
(85.6 KiB) Downloaded 400 times
roms_mangkhut.in
(153.22 KiB) Downloaded 358 times

carlosag
Posts: 24
Joined: Thu Sep 30, 2021 12:08 pm
Location: University of Iceland

Re: Model running error: REASON: KEchar = NaN, PEchar = NaN

#2 Unread post by carlosag »

Hi there, did you manage to solve this issue? I'm running into the same problem and I don't understand it.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Model running error: REASON: KEchar = NaN, PEchar = NaN

#3 Unread post by jcwarner »

there can be many reasons why the model is not starting.
i remember seeing this

GET_GRID - bathymetry at RHO-points: h
(Grid = 02, File: Projects/Mangkhut/Mangkhut_roms_grid_ref3.nc)
(Min = 0.00000000E+00 Max = 3.49541846E+03)

if your min depth is 0, you need to define wet_dry.
-j

carlosag
Posts: 24
Joined: Thu Sep 30, 2021 12:08 pm
Location: University of Iceland

Re: Model running error: REASON: KEchar = NaN, PEchar = NaN

#4 Unread post by carlosag »

Thank you very much for your answer. It helped me a lot.

Post Reply