Ask Your Question

Issue with time varying river BGC tracer reading

asked 2022-10-17 11:18:21 +0200


I'm experiencing an issue at present with CROCO-PISCES coupled. Running CROCO alone doesn't cause an issue with river data reading (time varying T/S are read fine and model runs fine). However, when I turn on PISCES, it seems the code trips on an issue reading BGC tracers for the river.

I have NO3_trc, DIC_trc, PO4_trc and Si_trc in my runoff file. I didn't have this issue when my river file previously only had T, S and NO3, but I don't want to revert to that option as it is less realistic. I have narrowed down the source of the error to /OCEAN/init_scalars.F and /OCEAN/get_psource_ts.F Specifically, in get_psource_ts.F, in this block of code: if (got_tsrc(itrc)) then lvar=lenstr(vname(1,indxTsrc+itrc-1)) ierr=nf_inq_varid (ncidqbar,vname(1,indxTsrc+itrc-1) & (1:lvar),tsrc_id(itrc)) if (ierr .eq. nf_noerr) then ierr=nf_inq_varndims (ncidqbar,tsrc_id(itrc), i) endif if (ierr .ne. nf_noerr) then write(stdout,3) vname(1,indxTsrc+itrc-1)(1:lvar), & qbarname(1:lstr)

I get an error because the way vname for the river tracers is dynamically derived from the main PISCES vars (DIC, TALK,...) in init_scalars.F introduces a repeated "null character" which is printed to screen as ^@ See the error below:

GET_PSOURCE_TS - unable to find forcing variable: NO3_src ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^$ in runoff NetCDF file:> analytical value (in analytical.F)

The issue only occurs with the 25th of 26 tracers (NO3) but it seems that the code doesn't even try to look for NH4 either.

I'm tempted to hard code the vname params for the rivers in init_scalars to get past this issue, but I can't understand why I'm having this issue as other people must have run their rivers for PISCES similarly to me, before now.

Would it help if I had all 26 tracers (T, S and PISCES vars (24)) from the rivers? Could it be an error introduced by ifort?

All suggestions would be greatly appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2022-10-17 17:50:57 +0200

I tried many things with this today, and found the solution, which is to increase the size of vname in ncscrum.h from vname(20,500) to vname(20,510)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2022-10-17 11:18:21 +0200

Seen: 38 times

Last updated: Oct 17 '22