archv2ncdf2d NPZD tracer

69 views
Skip to first unread message

Luana F. Bueno

unread,
Jul 10, 2024, 8:30:36 AM (12 days ago) Jul 10
to HYCOM.org Forum
Dear Alan, 

I'm getting the following error when running archv2ncdf2d: 
error in horout - from NetCDF library
NetCDF: Name contains illegal characters

What am I doing wrong here when trying to get tracer variable:
3  'yrflag' = days in year flag (0=360J16,1=366J16,2=366J01,3-actual)
4  'ntracr' = number of tracers (to output, optional with default 0)
tracer
tracer
tracer
tracer 
500  'idm   ' = longitudinal array size
 400  'jdm   ' = latitudinal  array size
...
 0 'tthio ' = layer k   dens,  I/O unit (0 no I/O)
 38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
 0 'sfnio ' = layer k  strmfn. I/O unit (0 no I/O)


I want to extract 4 tracers (NPZD), but I cannot make it work not even with 1 tracer. 

I do appreciate the help. 
Warm regards, 

Alan Wallcraft

unread,
Jul 10, 2024, 9:19:44 AM (12 days ago) Jul 10
to HYCOM.org Forum, Luana F. Bueno
From archv2data2d.f:

c ---   'ntracr' = number of tracers (to output, optional with default 0)
c ---    one name line per tracer: 8-letter plot and units, field, standard_
c ---      or separated by "|" (i.e. plot|units|field|standard).
c ---      the field name must only contain alphanumerics and "_", and
c ---      the standard_name is either blank or from the CF 1.0 conventions

           if     (i.eq.0) then  !8-letter plot and units, field has no spaces

            else  !separated by "|"

For example:

   3    'ntracr' = number of tracers (to output, optional with default 0)
  viscty m^2/s  viscosity   viscty
  t-diff m^2/s  t_diffusion t-diff
  s-diff m^2/s  s_diffusion s-diff

These are the "tracers" from difout=1, which will come before any actual tracers if present.

   1      'difout' = K-PROF:  output visc/diff coffs in archive (0=F,1=T)

The example uses the 8-letter layout, but the "|" layout is probably easier to enter correctly.

Your example failed because it does not have a field_name.  I would also use different (plot) names and you must use different field names if writing all the tracers to the same output file.

Alan.

Luana F. Bueno

unread,
Jul 10, 2024, 9:48:56 AM (12 days ago) Jul 10
to HYCOM.org Forum, Alan Wallcraft, Luana F. Bueno
Hi Alan, 
Many thanks for getting back to me. 

I have already been able to extract viscty , t-dif and s-diff when using difout=1. However, this is not the case now. 

Now I am running with NPZD tracers on (difout=0) and those are the ones I want to extract:
010  'iexpt ' = experiment number x10 (000=from archive file)

  3  'yrflag' = days in year flag (0=360J16,1=366J16,2=366J01,3-actual)
  1  'ntracr' = number of tracers (to output, optional with default 0)
tracer_N|mmolNm-3|tracer_N

500  'idm   ' = longitudinal array size
400  'jdm   ' = latitudinal  array size
...
  0 'tthio ' = layer k   dens,  I/O unit (0 no I/O)
 38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
 37 'sfnio ' = layer k  strmfn. I/O unit (0 no I/O)
 0  'kf    ' = first output layer (=0 end output; <0 label with layer #)

In the  archv.b, the tracers name are just tracers and we know it one is it one by the order.
Not sure how to proceed with to get over the error.  

Kind regards, 

Alan Wallcraft

unread,
Jul 10, 2024, 10:03:04 AM (12 days ago) Jul 10
to HYCOM.org Forum, Luana F. Bueno, Alan Wallcraft
You seem to have plot|field|units|standard this should be plot|units|field|standard

Your setup does not work because field (Nm-3) includes "-".

As you say. HYCOM does not "know" anything about these tracers except their order in the archive file.  This is the reason for the plot|units|field|standard lines, which provide your knowledge of what these represent.  If you have 4 tracers, set ntracr to 4 and define each one with plot|units|field|standard.  Control which gets written where (or not at all) with four 'trcio ' entries.

The field name is the variable name that gets written into the netCDF file.  It could just be N, P, Z, D (say) in your case.

Alan.

Luana F. Bueno

unread,
Jul 11, 2024, 5:28:48 AM (11 days ago) Jul 11
to HYCOM.org Forum, Alan Wallcraft, Luana F. Bueno
Got it, Alan. 
Many thanks for the help.

Below is the format that worked for me for future reference in the forum:

  3  'yrflag' = days in year flag (0=360J16,1=366J16,2=366J01,3-actual)
  4  'ntracr' = number of tracers (to output, optional with default 0)
tracerNI|mmolN/m3|N|N_tracer
tracerPY|mmolN/m3|P|P_tracer
tracerZO|mmolN/m3|Z|Z_tracer
tracerDE|mmolN/m3|D|D_tracer

500  'idm   ' = longitudinal array size
...
  0 'tthio ' = layer k   dens,  I/O unit (0 no I/O)
 38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
 38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
 38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
 38 'trcio ' = layer k tracer,  I/O unit (0 no I/O)
 37 'sfnio ' = layer k  strmfn. I/O unit (0 no I/O)


Kind regards, 
Reply all
Reply to author
Forward
0 new messages