geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
162 stars 155 forks source link

Missing output file when sampling the GCHP from a satellite track file #2270

Open herizonarivelo opened 2 months ago

herizonarivelo commented 2 months ago

Name and Institution (Required)

Name: Herizo Narivelo Institution: LAERO/OMP Université de Toulouse - Paul Sabatier

Confirm you have reviewed the following documentation

Description of your issue or question

Dear GEOS-Chem community,

I'm using GCHP v14.2.2 and I'm learning the GEOS-Chem model for my project. I'm running a one-day fullchem simulation from 2006-01-01 at 0h UTC with a 72 vertical level and a c48 of horizontal resolution. I would like to sample the GEOS-Chem model with the satellite OMI overpass time in order to well compare the NO2 concentration from GEOS-Chem simulation and from OMI satellite.

I followed what is indicated in this link (https://gchp.readthedocs.io/en/14.2.2/supplement/satellite-overpass.html) but I did not get any output like GCHP.OMI_NO2.20060101_0000z.nc4 file but only the file that contains the concentrations of the chemical species (GCHP.SpeciesConc.20060101_0000z.nc4).

Do I have to add OMI_NO2 to 'Declare collection names' in HISTORY.rc (COLLECTIONS in L61) or how can I obtain the file as indicated in the GHCHP documentation (for TROPOMI in this link https://gchp.readthedocs.io/en/14.2.2/supplement/satellite-overpass.html) .

I have updated my HISTORY.rc by adding the SatDiag collection from line L5953 (in HISTORY.rc.txt) with the OMI_NO2 collection.

I have attached the contain information of the satellite track file which I created using gcpy and my HISTORY.rc file.

Thank you in advance for your comments and precious help!

kind regards, Herizo Narivelo

HISTORY.rc.txt omi_overpass_c48.nc_ncdump.txt

lizziel commented 2 months ago

Hi @herizonarivelo, you will need to add the new collection to the collection list at the top of HISTORY.rc for the collection to be created. Try this and let us know if it is still not working.

lizziel commented 2 months ago

Heads up that I will move this issue to the GCHP GitHub once it is resolved. For now I will keep it here to avoid confusion.

herizonarivelo commented 2 months ago

Dear Lizziel

Thank you very much for your response. Of course, I've tried this option, but it still doesn't work.

I attach the HISTORY.rc file with the new collection and the gchp.log.

Thanks in advance for your reply!

Kind regards, Herizo

HISTORY.rc_modif.txt gchp.20060101_0000z.log.txt

yantosca commented 2 months ago

Hi @herizonarivelo, I noticed the log file has a bunch of these errors:

GEOS-Chem ERROR [0001]: Metadata not found for State_Diag field ID: GCHPCHEM. If the name in HISTORY.rc has species appended, make sure the species name is preceded by a single underscore. Otherwise, check that the name is listed with all capitals in subroutine Get_Metadata_State_Diag (Headers/state_diag_mod.F90).
 --> LOCATION:  -> at Get_Metadata_State_Diag (in Headers/state_diag_mod.F90)

I think that is because the OMI_NO2 collection is trying to archive SpeciesConc_NO2, which no longer exists. Try SpeciesConcVV_NO2 (for v/v) or SpeciesConcMND_NO2 (for #/cm3).

herizonarivelo commented 2 months ago

Hi @yantosca ,

Thank you very much for your reply @yantosca . By trying what you suggest, replacing SpeciesConc_NO2 with

  1. SpeciesConcVV_NO2 (for v/v)
  2. SpeciesConcMND_NO2(for #/cm3)

I have the same error in my GCHP.log output like you mentionned aboved.

I think that the introduction of OMI_NO2 in the collection list is generating the error but I don't have the answer at the moment.

If it's solved, I need to add another species like CH2O, CO and O3 for OMI and eventually add other satellites like TROPOMI and IASI.

I look forward to hearing from all you to resolve this issue.

Thanks in advance !

Kind regard, Herizo

gchp.20060101_0000z_VV.log.txt

lizziel commented 2 months ago

Hi @herizonarivelo, the error you are getting looks like a problem parsing HISTORY.rc:

GEOS-Chem ERROR [0003]: Metadata not found for State_Diag field ID: GCHPCHEM. If the name in HISTORY.rc has species appended, make sure the species name is preceded by a single underscore. Otherwise, check that the name is listed with all capitals in subroutine Get_Metadata_State_Diag (Headers/state_diag_mod.F90).
 --> LOCATION:  -> at Get_Metadata_State_Diag (in Headers/state_diag_mod.F90)

Nothing looks amiss in your HISTORY.rc file. This may be a long shot, but try removing the underscore from collection name. I wonder if that is tripping something up. I'll also do a run with satellite track on to see if I can reproduce.

lizziel commented 2 months ago

I noticed the whitespace between the variable name and closing apostrophe contains tabs. Try removing those.

herizonarivelo commented 2 months ago

Hi @lizziel

Thanks a lot for your reply. I have tested with your last tip and it seems that the error is the same and still persists. I wonder if adding a new collection on GCHP (in HISTORY) needs a modification/writing a Fortran program in ~/home//GCHPv14/src/GCHP_GridComp/GEOSChem_GridComp/geos-chem/

I enclose the output of my latest test according to your advice as removing the underscore and the space between the name of the variable and the appostrophe.

I am waiting for your reply to solve this issue. As a reminder, I ran a c48 fullchem simulation with 72 vertical levels with GCHP v14.2.2.

Thank you very much for your reply. setCommonRunSettings.sh.txt HISTORY.rc.txt slurm-6736776.out.txt gchp.20060101_0000z.log.txt

lizziel commented 2 months ago

Hi @herizonarivelo, you should not need to do anything in the fortran code for a new collection. Based on the error I think this is a parsing issue in GEOS-Chem file Headers/diaglist_mod.F90. It is interpretting the string GCHPchem, which is used in GCHP HISTORY.rc to indicated gridded component, as a diagnostic field name. It is then failing when it is time to get metadata for that diagnostic since there is no entry in state_diag_mod.F90 for it.

Try uncommenting the lines in this block of code, rebuild, and then rerun. Then post the log. I would like to see what is printed for the list of diagnostics that GEOS-Chem thinks are in HISTORY.rc.

lizziel commented 2 months ago

I was able to reproduce this when using your HISTORY.rc entry and fixed it by playing with the whitespace. You need to have a space between *.fields: and the diagnostic name, and also between the comma and the gridded component name. We can update the code to be more lenient about this.

herizonarivelo commented 2 months ago

Thank you very much, yes, following your advice to have just one space works.

Sorry if I'm late in replying, it took me a while to recompile. It works when I put only one white space.

herizonarivelo commented 2 months ago

Hi @lizziel ,

Thanks again for your advice and support. For this first test, I made a daily output (240000). In the meantime, I'd like to do a monthly output because the tropospheric NO2 and CH2O columns from the OMI and TROPOMI measurements are monthly averages.

If I keep a daily file on the output, I'll have several files. For example, a 10-year simulation represents around 3650 files, which will take up a lot of storage space. If it's a monthly average, the number of files will be reduced to 120 for a 10-year simulation.

I've been inspiration from other collections for monthly output, such as Emission, SpeciesConc, ProdLoss , etc.

I don't have an idea if what I'm going to do below is correct or not. I'm wondering if it's right

#==============================================================
  _OMI.template:       '%y4%m2%d2_%h2%n2z.nc4',
  OMI.format:         'CFIO',
  OMI.monthly:        1
  OMI.frequency:     010000
  OMI.duration:        010000
  OMI.track_file:     /home/narh/GCHPv14/GFAS_CEDS_test/omi_overpass_c48.nc
  OMI.recycle_track:  .true.
  OMI.mode:           'time-averaged'
  OMI.fields: 'SpeciesConcVV_NO2', 'GCHPchem',
              'SpeciesConcVV_CH2O', 'GCHPchem',
              'SpeciesConcVV_CO', 'GCHPchem',
::

I have change the mode: 'instantaneous' to 'time-averaged' and add this line:

OMI.monthly: 1 OMI.frequency: 010000 OMI.duration: 010000

And that's how it worked before, on a daily output

#==============================================================
 OMI.template:         '%y4%m2%d2_%h2%n2z.nc4',
 OMI.format:           'CFIO',
 OMI.duration:         240000
 OMI.track_file:       /home/narh/GCHPv14/GFAS_CEDS_test/omi_overpass_c48.nc
 OMI.recycle_track:    .true.
 OMI.mode:             'instantaneous'
 OMI.fields: 'SpeciesConcVV_NO2', 'GCHPchem',
              'SpeciesConcVV_CH2O', 'GCHPchem',
              'SpeciesConcVV_CO', 'GCHPchem',
::

Or should I do a daily output and then calculate the monthly averages basis the daily output?

I don't know if the "omi_overpass_c48.nc" file I've created is consistent with the monthly output configuration in the HISTORY.rc file.

Thanks a lot for your return.

Herizo

lizziel commented 2 months ago

Hi @herizonarivelo, I am glad it is working now. There are limitations when using the satellite track in GCHP. Monthly diagnostics are not possible because you can only output instantaneous results with the feature. See the "Note" in blue on the GCHP ReadTheDocs page: "1D output only works for instantaneous sampling."

herizonarivelo commented 2 months ago

Hi @lizziel , many thanks for your return. So, I need to compute the monthly averages basis the daily output if I well understand.

lizziel commented 2 months ago

That is correct.