Regarding the issue of psource_ncfile

Dear scholars, here is the error message I received:
First, I will show you the “qbar_time” data from my “river_runoff” file:
qbar_time = 10028 ;
n_qbar = 6 ;
runoffname_StrLen = 30 ;
two = 2 ;
temp_src_time = 10028 ;
salt_src_time = 10028 ;
variables:
double qbar_time(qbar_time) ;
qbar_time:long_name = “runoff time” ;
qbar_time:units = “days since 1900-01-01 00:00:00” ;
qbar_time:cycle_length = 0. ;
double temp_src_time(temp_src_time) ;
temp_src_time:cycle_length = 0. ;
temp_src_time:units = “days since 1900-01-01 00:00:00” ;
double salt_src_time(salt_src_time) ;
salt_src_time:cycle_length = 0. ;
salt_src_time:units = “days since 1900-01-01 00:00:00” ;
char runoff_name(runoffname_StrLen, n_qbar) ;
runoff_name:long_name = “runoff name” ;
double runoff_position(two, n_qbar) ;
runoff_position:long_name = “position of the runoff (by line) in the CROCO grid” ;
double runoff_direction(two, n_qbar) ;

    double Qbar(qbar_time, n_qbar) ;
            Qbar:long_name = "runoff discharge" ;
            Qbar:units = "m3.s-1" ;
    double temp_src(temp_src_time, n_qbar) ;
            temp_src:long_name = "runoff temperature" ;
            temp_src:units = "Degrees Celcius" ;
    double salt_src(salt_src_time, n_qbar) ;
            salt_src:long_name = "runoff salinity" ;
            salt_src:units = "psu" ;

  The data on river flow, salinity and temperature all cover the simulated time period.So, for some unknown reason, the following problem occurred and the display was 9939.

GET_INITIAL - unable to find variable: hbl
in input NetCDF file: CROCO_FILES/croco_ini_mercator_Y2025M01.nc ==> Initialized to zero state.
>> CAUTION in case of #define EXACT_RESTART <<
If it is the case
- OK if it is a ‘cold start’ i.e coming from a 3rd-party initial file
- otherwise if it is a ‘hot start’ i.e from a restart file produced by this code:
=> problem: run is not restartable
=> check your initial file
Ntimes from date_start and date_end: 169920

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

MAIN - number of records written into history file(s): 0
number of records written into restart file(s): 0
number of records written into averages file(s): 0

ERROR: Abnormal termination: netCDF INPUT

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939
GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939
GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939
GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

GET_PSOURCE - ERROR while reading variable: QBAR at TIME index = 9939

The data on river flow, salinity and temperature all cover the simulated time period.So, for some unknown reason, the following problem occurred and the display was 9939.

Hello,

Are you using USE_CALENDAR in your cppdefs.h ?

I see you have “days since 1900-01-01 00:00:00” in your time unit, if you are not using USE_CALENDAR, this means you begin your simulation in 1900-01-01, which I guess is not what you want and can lead to this kind of error.

If this is the case, you can :

  • define USE_CALENDAR (and then check your start_date, end_date and ways to define output frequency in your croco.in file).
  • or change your time axis in your rivers .nc file to fit your start date of simulation

Hope this is clear :sweat_smile:

First of all, I would like to thank you for your reply.
The reason has been found. I only created a file by selecting the rivers within the simulated time period. This way, the file can be run. Even if the river includes the simulated time period, the starting time of the file does not match the start time of the simulation, which may cause the aforementioned problem.
Thank you again. Best wishes! :grin:.