# \[v.4.0.x\] Instability error and "p4zopt.f90" crash issue that occur on the same day

**URL:** https://nemo-ocean.discourse.group/t/v-4-0-x-instability-error-and-p4zopt-f90-crash-issue-that-occur-on-the-same-day/312
**Category:** v4.0.x
**Tags:** P4Z, PISCES
**Created:** [28 June 2022 07:57 UTC](https://nemo-ocean.discourse.group/t/v-4-0-x-instability-error-and-p4zopt-f90-crash-issue-that-occur-on-the-same-day/312 "2022-06-28T07:57:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jin](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jin](https://nemo-ocean.discourse.group/u/Jin)
#### Post date: [28 June 2022 07:57 UTC](https://nemo-ocean.discourse.group/t/v-4-0-x-instability-error-and-p4zopt-f90-crash-issue-that-occur-on-the-same-day/312/1 "2022-06-28T07:57:51Z")

</div>

Dear all,

I have set up ORCA2\_ICE\_PISCES in NEMO v4.0.6 using gfortran compiler.  
I met two significant errors for running model, which are the instability error and the _p4zopt.f90_ crash issue. I solved the problem temporarily by controlling the time interval (`rn_rdt`).  
First, encountered the instability error, I reduced the time interval of model (`rn_rdt`).  
Second, in “_p4zopt.f90_ crash issue”, I slightly increased the time step near the point.  
However, in 2012, there was a serious trouble where two problems occurred at the same time on the same day. (I hope that the model runs by 2021.) I don’t know how to solve this problem.  
Any suggestions and advices would be appreciated. Experimental setup and related files are below.  
Thank you in advance.

Best regards,

Hwa-Jin Choi

* * *

**1. Instability error**

> **ocean.output\_0052**
>
> ```nohighlight
> ===>>> : E R R O R
> 
> STOP
> stp_ctl: |ssh| > 20 m or |U| > 10 m/s or S <= 0 or S >= 100 or NaN encounter in the tests
> 
> kt 394 |ssh| max 0.000 at i j 182 109 MPI rank 52
> kt 394 |U| max 0.000 at i j k 182 109 1 MPI rank 52
> kt 394 Sal min NaN at i j k 163 106 1 MPI rank 52
> kt 394 Sal max NaN at i j k 163 106 1 MPI rank 52
> => output of last computed fields in output.abort* files
> 
> huge E-R-R-O-R : immediate stop
> 
> ```

**2. p4zopt.f90 crash issue**

> **I receive the following message**
>
> ```nohighlight
> Error termination. Backtrace:
> At line 132 of file /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/p4zopt.f90
> Fortran runtime error: Index '0' of dimension 2 of array 'rkrgb' below lower bound of 1
> Error termination. Backtrace:
> #0 0x1529e9010d21 in ???
> #1 0x1529e9011869 in ???
> #2 0x1529e9011ee6 in ???
> #3 0x55c6340a63a2 in __p4zopt_MOD_p4z_opt
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/p4zopt.f90:132
> #4 0x55c634adcbf2 in __p4zbio_MOD_p4z_bio
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/p4zbio.f90:121
> #5 0x55c6341b4d8d in __p4zsms_MOD_p4z_sms
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/p4zsms.f90:163
> #6 0x55c63458ac6b in __trcsms_pisces_MOD_trc_sms_pisces
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/trcsms_pisces.f90:81
> #7 0x55c63458611a in __trcsms_MOD_trc_sms
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/trcsms.f90:92
> #8 0x55c63326ab27 in __trcstp_MOD_trc_stp
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/trcstp.f90:144
> #9 0x55c63307c9a9 in __step_MOD_stp
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/step.f90:237
> #10 0x55c632fd8b7c in __nemogcm_MOD_nemo_gcm
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/BLD/ppsrc/nemo/nemogcm.f90:192
> #11 0x55c632fd3f91 in nemo
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/WORK/nemo.f90:18
> #12 0x55c632fd3fca in main
> at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/ORCA_test4/WORK/nemo.f90:11
> 
> ```

**Experimental Setup**

- JRA55 reanalysis data was prescribed to surface boundary condition.
- The COARE 3.5 algorithm in bulk formulation was used to calculate fluxes from the atmosphere.
- Atmospheric pCO2 was changed as an annual observation data.
- The monthly satellite observation for chlorophyll was used.

→ The model had run from 1960 to 2012. I hope that the model runs by 2021.

**My arch file:**

```perl
%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
%NCDF_LIB -L%NCDF_HOME -lnetcdff -lnetcdf -lstdc++
%XIOS_INC -I%XIOS_HOME/inc
%XIOS_LIB -L%XIOS_HOME/lib -lxios -L/usr/lib/gcc/x86_64-linux-gnu/9 -lstdc++

%OASIS_INC -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
%OASIS_LIB -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip

%CPP /usr/bin/cpp-9 -Dkey_nosignedzero
%CPPFLAGS -P -traditional

%FC /media/cmlws/Data1/hjc/Tools/install/bin/mpif90
%FCFLAGS -fdefault-real-8 -funroll-all-loops -cpp -fcray-pointer -ffree-line-length-none -g -O0 -fbacktrace
%FFLAGS %FCFLAGS
%LD /media/cmlws/Data1/hjc/Tools/install/bin/mpif90
%LDFLAGS
%FPPFLAGS -P -C -traditional
%AR ar
%ARFLAGS -rs
%MK make
%USER_INC %XIOS_INC %OASIS_INC %NCDF_INC
%USER_LIB %XIOS_LIB %OASIS_LIB %NCDF_LIB

%CC gcc
%CFLAGS -O0 -fbacktrace

```

---

<div class="post-metadata">

### Author: ![robinson](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@robinson](https://nemo-ocean.discourse.group/u/robinson)
#### Post date: [24 August 2026 05:19 UTC](https://nemo-ocean.discourse.group/t/v-4-0-x-instability-error-and-p4zopt-f90-crash-issue-that-occur-on-the-same-day/312/2 "2026-08-24T05:19:23Z")

</div>

Hei Hwa-Jin,

Did you solve your issue ? I think i experience something similar. I searched, and found that the error occurs because of an array overlap issue in p4zopt.f90, which itself is caused simply because PISCES diverges (i.e.: produces NaNs).

I am wondering what can cause this, as active tracers advection/diffusion runs fine without pisces.

Any feedback is welcome,

Cheers,

Robinson

---

<div class="post-metadata">

### Author: ![robinson](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@robinson](https://nemo-ocean.discourse.group/u/robinson)
#### Post date: [24 August 2026 05:41 UTC](https://nemo-ocean.discourse.group/t/v-4-0-x-instability-error-and-p4zopt-f90-crash-issue-that-occur-on-the-same-day/312/3 "2026-08-24T05:41:06Z")

</div>

But in your case, the physics also diverges, based on your output files.
