Make: *** [combine.exe] Error 2 undefined reference to `nf_get_vara_text_

Hello @cjcoats @hogrefe.christian

I am trying to build combine.exe from AMETV1.4 (I had successfully built it from AMET V1.2). Here is what I did (attached makefile Makefile_combine.txt (2.4 KB) :

  1. I modified the library and ioapi path as my system.
  2. I modified FSTD = -Mextend -O2 -fast -V -Msecond_underscore
  3. I removed -fixed -132 from f- FLAGS

Then when I make it I am getting following error:

file.F:1004: undefined reference to nf_inq_dimid__' /run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1004: undefined reference to nf_inq_dimid__’
/run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1007: undefined reference to nf_inq_dimid__' module_file.o:/run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1007: more undefined references to nf_inq_dimid__’ follow
module_file.o: In function m3files_wrf_desc__': /run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:945: undefined reference to nf_inq_varid__’
/run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1018: undefined reference to nf_inq_nvars__' /run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1023: undefined reference to nf_inq_var__’
/run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1054: undefined reference to nf_get_att_text__' /run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:1055: undefined reference to nf_get_att_text__’
/run/media/root/55A07B0360BDF544/postproc/AMET_v14/tools_src/combine/src/module_file.F:957: undefined reference to `nf_get_vara_text__’
make: *** [combine.exe] Error 2

Note: Please see my Makeinclude.Linux3 file from ioapi ( Makeinclude.Linux3.txt (1.9 KB) )

Please help

This may or may not be the cause of the problem, but it seems you have different options for second_underscore in Makeinclude.Linux3.txt and Makefile_combine.txt

Makeinclude.Linux3.txt:

FOPTFLAGS = -O2 -V -Mnosecond_underscore

Makefile_combine.txt:

FSTD = -Mextend -O2 -fast -V -Msecond_underscore

Try changing the setting in Makefile_combine.txt to -Mnosecond_underscore to match what you did when you built I/O API.

I think this may be the exact same issue you ran into when compiling airs2m3, and the solution may also be the same.

Hello @hogrefe.christian

Thank you for the reply. I was able to compile it by using -Mnosecond_underscore. But I can compile all other tools (sitecmp.exe ; sitecmp_dailyo3.exe ; bldoverlay.exe) by using -Msecond_underscore.

After, That I build a database by using /scripts_db/dbsetup/create_amet_user.csh and ran aqExample/aqProject_post_only.csh by considering option T for load_sitex, run_sitex, and write_sitex.

But when I tried to run /script_analysis/aqExample/stats_plot_leaflet.csh , I am getting following error ( attached log file and script run_stats_plots_leaflet.txt (5.0 KB) stats_plots_leaflet.log.txt (3.1 KB)

7: In .local(conn, statement, …) :
Unsigned INTEGER in col 10 imported as numeric
8: In .local(conn, statement, …) :
Unsigned INTEGER in col 11 imported as numeric
9: In .local(conn, statement, …) :
Unsigned INTEGER in col 12 imported as numeric
10: In .local(conn, statement, …) :
Unsigned INTEGER in col 21 imported as numeric
Execution halted

Please help

Hi,

Your error suggests that the species PM25_TOT is not in the database. This is likely an error during the earlier AMET processes. Do you have the log file available for the aqProject_post_only.csh script? That would reveal any errors.

Wyat

Hello @wyat.appel

I have tried using this script aqProject_post_only_julyARDEQ.txt (7.1 KB) and terminal log file of this run ( some lines of the terminal.log.txt (176.5 KB) ). It produces these files IMPROVE_ARDEQ_JUL_TRIAL.csv (1.2 MB) sitex_IMPROVE_ARDEQ_JUL_TRIAL.txt (4.4 KB)

Then I tried to run these script run_scatterplot.txt (5.3 KB) and got this error scatterplot.log.txt (1.8 KB)

Note: my combine.exe files are spec_def.camxv7.elements.txt (1.1 KB) ARDEQ_combine.ADEQ_AR_2020.txt (993 Bytes)

Like @wyat.appel suggested and your files confirm, your underlying error is that sitecompare cannot find the modeled PM species it is expecting, and the reason for this is that you are working with CAMx PM species. Look at terminal.log.txt - it tells you that sitecompare cannot find the modeled species specified in the sitex_IMPROVE_ARDEQ_JUL_TRIAL.txt run script, and it also tells you which (CAMx) model PM species you actually have in your files. As a result of not being able to find the expected PM species, all model output written to the sitecompare output csv file is missing, which of course then leads to crashes when you try to use AMET analysis scripts.

To start fixing your issue, please have a look at the general post-processing concepts described here

You then need to decide at which stage you want to make modifications to the tools used by AMET (combine and sitecompare) to make them work for your data. I cannot give guidance on CAMx species and what they represent, but in general, you have two options to approach this:

  • modify the combine mechanism-specific SpecDef file (e.g. this one) referenced by aqProject_pre_and_post.csh so that it estimates the expected CMAQ species (i.e. the species in the first column) from available CAMx species (i.e. the species in the third column). For this, you can focus on the CMAQ species expected for the sitecompare matching script. In AMET, this is controlled by AMET_species_list.input, i.e. in AMET, this is the file that controls the auto-generation of the sitecompare run scripts which list the model species expected to be available for each network to pair with available observations.

  • If you prefer not to modify the SpecDef file that controls which species get written to the combine output file, you’ll instead need to modify AMET_species_list.input for all networks you’re interested to specify CAMx model species available from your combine output file. This will require some knowledge of which CAMx species are comparable to which observational species.

Of course, you can also use a combination of these approaches, e.g. map the CAMx PM species to the CMAQ aero7 species to the extent possible by modifying the SpecDef file, and then also edit AMET_species_list.input for all networks you’re interested to remove references to any CMAQ aero7 species you may not be able to estimate from your CAMx PM species.

1 Like

Hello @wyat.appel @hogrefe.christian

Thank you so much for the help. I modified spec_def list and successfully created a scatterplot by using /script_analysis/aqExample/run_scatterplot.csh.