Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG/ISSUE] Possible parallelization error in MEGAN extension #109

Closed
yantosca opened this issue Sep 21, 2021 · 2 comments
Closed

[BUG/ISSUE] Possible parallelization error in MEGAN extension #109

yantosca opened this issue Sep 21, 2021 · 2 comments
Labels
category: Bug Something isn't working stale No recent activity on this issue topic: HEMCO Extensions Pertaining to HEMCO extensions

Comments

@yantosca
Copy link
Contributor

While debugging the HMS chemistry for GEOS-Chem 13.3.0, I noticed that there may be a possible parallelization error in the HEMCO emissions extension (HEMCO/src/Extensions/hcox_megan_mod.F90). Below is shown some the output of debug print statements at grid box (64,16).

       !--------------------------------------------------------------------
       ! MEGAN Isoprene
       !--------------------------------------------------------------------

       ! Isoprene [kg/m2/s]
       CALL GET_MEGAN_EMISSIONS( HcoState, ExtState, Inst, &
                                 I, J, 'ISOP', EMIS_ISOP, RC )
       IF ( RC /= HCO_SUCCESS ) THEN
          CALL HCO_ERROR( HcoState%Config%Err, &
                          'GET_MEGAN_EMISSIONS_ISOP', RC )
          ERR = .TRUE.
          EXIT
       ENDIF

       IF ( I == 64 .and. J == 16 ) THEN
          print*, '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
          print*, '@@@ debug box         : ', I, J
          print*, '@@@ EMIS_ISOP         : ', EMIS_ISOP
       ENDIF


       !FP_ISOP (6/2009)
       EMIS_ISOP = Inst%ISOP_SCALING * EMIS_ISOP

       ! Write isoprene emissions into tracer tendency array
       IF ( Inst%IDTISOP > 0 ) THEN
          Inst%FLUXISOP(I,J) = EMIS_ISOP
       ENDIF

       ! Biogenic emissions of SOA and SOA-Precursor from isopene
       ! NOTE: These emission factors appear to be based on emissions
       !  in kgC/m2/s. Convert from kg/m2/s to kgC/m2/s.
       IF ( (Inst%IDTISOP>0) .AND. (Inst%IDTSOAP>0) ) THEN
          Inst%FLUXSOAP(I,J) = Inst%FLUXSOAP(I,J) + &
               ( EMIS_ISOP * MONOtoC ) * Inst%ISOPTOSOAP
       ENDIF
       IF ( (Inst%IDTISOP>0) .AND. (Inst%IDTSOAS>0) ) THEN
          Inst%FLUXSOAS(I,J) = Inst%FLUXSOAS(I,J) + &
               ( EMIS_ISOP * MONOtoC ) * Inst%ISOPTOSOAS
       ENDIF

       IF ( I == 64 .and. J == 16 ) THEN
          print*, '@@@ EMIS_ISOP, scaled : ', EMIS_ISOP
          print*, '@@@ Inst%FLUXISOP     : ', Inst%FluxISOP(I,J)
          print*, '@@@ MonoToC           : ', MonoToC
          print*, '@@@ Inst%ISOPtoSOAP   : ', Inst%ISOPtoSOAP 
          print*, '@@@ Inst%FLUXSOAP     : ', Inst%FluxSOAP(I,J)
          print*, '@@@ Inst%ISOPtoSOAS   : ', Inst%ISOPtoSOAS 
          print*, '@@@ Inst%FluxSOAS     : ', Inst%FluxSOAS(I,J)
       ENDIF

As you can see, a run with parallelization off and parallelization on (in GEOS-Chem Classic) gives different results for the same grid box.

threads = 1
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @@@ debug box         :           64          16
 @@@ EMIS_ISOP         :    5.8587319979935122E-012
 @@@ EMIS_ISOP, scaled :    5.8587319979935122E-012
 @@@ Inst%FLUXISOP     :    5.8587319979935122E-012
 @@@ MonoToC           :   0.88066930867459270     
 @@@ Inst%ISOPtoSOAP   :    1.7009999155998230E-002
 @@@ Inst%FLUXSOAP     :    8.7764884492372937E-014
 @@@ Inst%ISOPtoSOAS   :    1.7009999155998230E-002
 @@@ Inst%FluxSOAS     :    8.7764884492372937E-014

threads = 6
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @@@ debug box         :           64          16
 @@@ EMIS_ISOP         :    5.8591508679011592E-012
 @@@ EMIS_ISOP, scaled :    5.8591508679011592E-012
 @@@ Inst%FLUXISOP     :    5.8591508679011592E-012
 @@@ MonoToC           :   0.88066930867459270     
 @@@ Inst%ISOPtoSOAP   :    1.7009999155998230E-002
 @@@ Inst%FLUXSOAP     :    8.7771159240744168E-014
 @@@ Inst%ISOPtoSOAS   :    1.7009999155998230E-002
 @@@ Inst%FluxSOAS     :    8.7771159240744168E-014

@msulprizio and I were thinking that this may have come in with one of the recent MEGAN updates or LAI updates. This issue may have also gone undetected for a long time.

@stale
Copy link

stale bot commented Oct 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days it will be closed. You can add the "never stale" tag to prevent the Stale bot from closing this issue.

@stale stale bot added the stale No recent activity on this issue label Oct 22, 2021
@stale
Copy link

stale bot commented Oct 29, 2021

Closing due to inactivity

@stale stale bot closed this as completed Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working stale No recent activity on this issue topic: HEMCO Extensions Pertaining to HEMCO extensions
Projects
None yet
Development

No branches or pull requests

1 participant