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
171 stars 166 forks source link

The 'LUC' value is faulty in 'drydep_mod.F90' #2602

Open CH2-littlefat opened 5 days ago

CH2-littlefat commented 5 days ago

Your name

CH2

Your affiliation

SCUT(South China University of Technology)

What happened? What did you expect to happen?

I was running simulations with GEOS-Chem and the program reported a 'SIGBUS' error.

'GC.log' displays the following error information

>  ********************************************
> * B e g i n   T i m e   S t e p p i n g !! *
> 
> Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
> 
> Backtrace for this error:
> 
> Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
> 
> Backtrace for this error:
> #0  0x2b9b9d0193ff in ???
> #0  0x2b9b9d0193ff in ???
> 
> Program received signal SIGBUS: Access to an undefined portion of a memory object.
> 
> Backtrace for this error:
> #0  0x2b9b9d0193ff in ???
> #1  0x443120 in adust_sfcrsii
> #1  0x443120 in adust_sfcrsii
>   at /root/桌面/software/GEOS-Chem/001-DMS-clean/CodeDir/src/GEOS-Chem/GeosCore/drydep_mod.F90:4138
>   at /root/桌面/software/GEOS-Chem/001-DMS-clean/CodeDir/src/GEOS-Chem/GeosCore/drydep_mod.F90:4138
> #2  0x443120 in __drydep_mod_MOD_depvel._omp_fn.0
> #2  0x443120 in __drydep_mod_MOD_depvel._omp_fn.0
>   at /root/桌面/software/GEOS-Chem/001-DMS-clean/CodeDir/src/GEOS-Chem/GeosCore/drydep_mod.F90:1876
>   at /root/桌面/software/GEOS-Chem/001-DMS-clean/CodeDir/src/GEOS-Chem/GeosCore/drydep_mod.F90:1876
> #3  0x2b9b9c765404 in ???
> #3  0x2b9b9c75d05e in ???
> #4  0x2b9b9cdceea4 in ???
> #4  0x44e317 in depvel
> #5  0x2b9b9d0e1b0c in ???
>   at /root/桌面/software/GEOS-Chem/001-DMS-clean/CodeDir/src/GEOS-Chem/GeosCore/drydep_mod.F90:2255
> #6  0xffffffffffffffff in ???
> #5  0x44e317 in __drydep_mod_MOD_do_drydep
>   at /root/桌面/software/GEOS-Chem/001-DMS-clean/CodeDir/src/GEOS-Chem/GeosCore/drydep_mod.F90:331

It seems like some variables in 'drydep_mod.F90:4138' is undefined: (line 4115 to 4138)


    DATA   A / 2.0e+0_f8,   5.0e+0_f8,   2.0e+0_f8,   5.0e+0_f8,  5.0e+0_f8, &
               2.0e+0_f8,   2.0e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &
              10.0e+0_f8, -999.e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &

               2.0e+0_f8,   5.0e+0_f8,   2.0e+0_f8,   5.0e+0_f8,  5.0e+0_f8, &
               2.0e+0_f8,   2.0e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &
              10.0e+0_f8, -999.e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &

               2.0e+0_f8,   5.0e+0_f8,   5.0e+0_f8,  10.0e+0_f8,  5.0e+0_f8, &
               5.0e+0_f8,   5.0e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &
              10.0e+0_f8, -999.e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &

               2.0e+0_f8,   5.0e+0_f8,   5.0e+0_f8,  10.0e+0_f8,  5.0e+0_f8, &
               5.0e+0_f8,   5.0e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &
              10.0e+0_f8, -999.e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &

               2.0e+0_f8,   5.0e+0_f8,   2.0e+0_f8,   5.0e+0_f8,  5.0e+0_f8, &
               2.0e+0_f8,   2.0e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8, &
              10.0e+0_f8, -999.e+0_f8, -999.e+0_f8, -999.e+0_f8, 10.0e+0_f8  /

    ! Annual average of A
    Aavg(:) = (A(:,1)+A(:,2)+A(:,3)+A(:,4)+A(:,5))/5.
    LUC     = LUCINDEX(II)
    AA      = Aavg(LUC) * 1.e-3_f8 

I found that the value of 'LUC' is too large (about 10^10) but I do not how does the program calculate this value. Is there something wrong in function 'LUCUNDEX'? I want to know how to solve the problem of excessive 'LUC' values.

What are the steps to reproduce the bug?

A similar problem appeared in GEOS-Chem-14.3.1. But I can run simulation in GEOS-Chem-14.1.0 successfully.

Please attach any relevant configuration and log files.

GC.txt geoschem_config.txt HEMCO_Config.txt HEMCO_Diagn.txt HISTORY.txt

What GEOS-Chem version were you using?

14.5.0

What environment were you running GEOS-Chem on?

Local cluster

What compiler and version were you using?

gcc 10.2.0

Will you be addressing this bug yourself?

No

In what configuration were you running GEOS-Chem?

GCClassic

What simulation were you running?

Full chemistry

As what resolution were you running GEOS-Chem?

2x2.5

What meterology fields did you use?

MERRA-2

Additional information

No response

yantosca commented 1 day ago

Thanks for writing. Are you using an "out-of-the-box" 14.5.0 version or did you make additional modifications to the code? If you have made modifications, try building a "clean" 14.5.0 version and see if that has the same error.

I suspect the error could be be caused by an out-of-bounds error or similar error. It could also mean that you have exceeded a memory limit on your system.

First, try reconfiguring with the -DCMAKE_RELEASE_TYPE=Debug and recompile the model to build a new excecutable. Then run that and see if it gives a new error message.

Also see our the following Supplemental Guides on ReadTheDocs:

CH2-littlefat commented 13 hours ago

Thanks for @yantosca's reply.

I have modified the chemical model of GEOS-Chem by KPP, and didn't change the other code.

I will try to build a 'clean' 14.5.0 version again and use -DCMAKE_RELEASE_TYPE=Debug to compile the model.