From 2c2c0dc50f519b318cae04ef4387e91b96b6db06 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Wed, 23 Oct 2024 16:47:25 -0400 Subject: [PATCH] Fix build errors in GEOS code due to changes in recent GEOS-Chem version Signed-off-by: Lizzie Lundgren --- CHANGELOG.md | 1 + Interfaces/GEOS/Includes_After_Run.H | 5 +++-- Interfaces/GEOS/Includes_Before_Run.H | 4 ++-- Interfaces/GEOS/geos_CarbonInterface.F90 | 18 +++++++++--------- Interfaces/GEOS/geos_interface.F90 | 14 ++++++++------ 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4b7862b3..fb5944f87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fixed segmentation fault in qfyaml when running with certain compilers without debug flags on - Fixed errors in adjoint-only code preventing successful adjoint build - Fixed zero convective precipitation and high cloud base in runs using GEOS-FP (>=01Jun2020) or GEOS-IT +- Updated GEOS-only code for compatibility with GEOS-Chem 14.5 ### Removed - Removed duplicate `WD_RetFactor` tag for HgClHO2 in `species_database.yml` diff --git a/Interfaces/GEOS/Includes_After_Run.H b/Interfaces/GEOS/Includes_After_Run.H index cedf4289b..f34a4f084 100644 --- a/Interfaces/GEOS/Includes_After_Run.H +++ b/Interfaces/GEOS/Includes_After_Run.H @@ -42,7 +42,7 @@ !BOC !========================================================================= - ! Pass advected tracers from GEOS-Chem tracers array to internal state + ! Pass tracers from GEOS-Chem tracers array to internal state !========================================================================= DO I = 1, SIZE(Int2Spc,1) IF ( Int2Spc(I)%ID <= 0 ) CYCLE @@ -54,8 +54,9 @@ ENDIF ! testing only !if(MAPL_am_I_Root()) write(*,*) 'Copied to internal: ',I,Int2Spc(I)%ID,trim(Int2Spc(I)%Name),MINVAL(State_Chm%Species(Int2Spc(I)%ID)%Conc(:,:,LM:1:-1)),MAXVAL(State_Chm%Species(Int2Spc(I)%ID)%Conc(:,:,LM:1:-1)),SUM(State_Chm%Species(Int2Spc(I)%ID)%Conc(:,:,LM:1:-1))/IM/JM/LM + State_Chm%Species(I)%Units = KG_SPECIES_PER_KG_TOTAL_AIR ENDDO - State_Chm%Spc_Units = KG_SPECIES_PER_KG_TOTAL_AIR + !========================================================================= ! Various other archived variables needed in internal state. diff --git a/Interfaces/GEOS/Includes_Before_Run.H b/Interfaces/GEOS/Includes_Before_Run.H index 5ec185a7f..a408047d5 100644 --- a/Interfaces/GEOS/Includes_Before_Run.H +++ b/Interfaces/GEOS/Includes_Before_Run.H @@ -233,7 +233,7 @@ ENDDO !========================================================================= - ! Pass advected tracers from internal state to GEOS-Chem tracers array + ! Pass all tracers from internal state to GEOS-Chem tracers array ! Species in internal state are in kg/kg total. GEOS-Chem will convert ! them to kg/kg dry internally. !========================================================================= @@ -246,8 +246,8 @@ State_Chm%Species(Int2Spc(I)%ID)%Conc(:,:,LM:1:-1) = Int2Spc(I)%Internal(:,:,:) ENDIF !IF ( MAPL_am_I_Root() ) WRITE(*,*) 'Copying from internal: ',I,Int2Spc(I)%ID,MINVAL(Int2Spc(I)%Internal(:,:,:)),MAXVAL(Int2Spc(I)%Internal(:,:,:)),SUM(Int2Spc(I)%Internal(:,:,:))/IM/JM/LM + State_Chm%Species(I)%Units = KG_SPECIES_PER_KG_TOTAL_AIR ENDDO - State_Chm%Spc_Units = KG_SPECIES_PER_KG_TOTAL_AIR !========================================================================= ! Various other archived variables needed in internal state. Eventually, diff --git a/Interfaces/GEOS/geos_CarbonInterface.F90 b/Interfaces/GEOS/geos_CarbonInterface.F90 index 4d552504d..e1574cf8b 100644 --- a/Interfaces/GEOS/geos_CarbonInterface.F90 +++ b/Interfaces/GEOS/geos_CarbonInterface.F90 @@ -624,7 +624,7 @@ SUBROUTINE GEOS_CarbonRunPhoto( Input_Opt, State_Chm, State_Met, & CHARACTER(LEN=*), PARAMETER :: myname = 'GEOS_CarbonRunPhoto' CHARACTER(LEN=*), PARAMETER :: Iam = myname - INTEGER :: origUnit + INTEGER :: previous_units REAL, ALLOCATABLE :: aj(:) INTEGER :: I, J, L, LM, STATUS INTEGER :: indCO, indCO2, indO3 @@ -641,13 +641,13 @@ SUBROUTINE GEOS_CarbonRunPhoto( Input_Opt, State_Chm, State_Met, & ! Convert to molec/cm3 units are molec/cm3 CALL Convert_Spc_Units( & - Input_Opt = Input_Opt, & - State_Chm = State_Chm, & - State_Grid = State_Grid, & - State_Met = State_Met, & - outUnit = MOLECULES_SPECIES_PER_CM3, & - origUnit = origUnit, & - RC = RC ) + Input_Opt = Input_Opt, & + State_Chm = State_Chm, & + State_Grid = State_Grid, & + State_Met = State_Met, & + new_units = MOLECULES_SPECIES_PER_CM3, & + previous_units = previous_units, & + RC = RC ) ASSERT_(RC==GC_SUCCESS) ! Chemistry time step in secods @@ -725,7 +725,7 @@ SUBROUTINE GEOS_CarbonRunPhoto( Input_Opt, State_Chm, State_Met, & State_Chm = State_Chm, & State_Grid = State_Grid, & State_Met = State_Met, & - outUnit = origUnit, & + new_units = previous_units, & RC = RC ) ASSERT_( RC == GC_SUCCESS ) diff --git a/Interfaces/GEOS/geos_interface.F90 b/Interfaces/GEOS/geos_interface.F90 index 5665198ed..7dd1e6830 100644 --- a/Interfaces/GEOS/geos_interface.F90 +++ b/Interfaces/GEOS/geos_interface.F90 @@ -326,7 +326,7 @@ SUBROUTINE GEOS_RATSandOxDiags( GC, Internal, Export, Input_Opt, State_Met, & REAL, POINTER :: PTR_O1D(:,:,:) => NULL() REAL, ALLOCATABLE :: OXLOCAL(:,:,:) LOGICAL :: NeedO3 - INTEGER :: OrigUnit + INTEGER :: previous_units __Iam__('GEOS_RATSandOxDiags') @@ -336,7 +336,8 @@ SUBROUTINE GEOS_RATSandOxDiags( GC, Internal, Export, Input_Opt, State_Met, & ! Make sure that species are in kg/kg total. This should be the case already, ! but better be safe! CALL Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & - outUnit=KG_SPECIES_PER_KG_TOTAL_AIR, OrigUnit=OrigUnit, RC=RC ) + new_units=KG_SPECIES_PER_KG_TOTAL_AIR, & + previous_units=previous_units, RC=RC ) !======================================================================= ! Fill RATS export states if GC is the RATS provider @@ -437,7 +438,7 @@ SUBROUTINE GEOS_RATSandOxDiags( GC, Internal, Export, Input_Opt, State_Met, & ! Convert back to original unit CALL Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & - OutUnit=OrigUnit, RC=RC ) + new_units=previous_units, RC=RC ) ! All done RETURN_(ESMF_SUCCESS) @@ -489,7 +490,7 @@ SUBROUTINE GEOS_SetH2O( GC, Input_Opt, State_Met, & ! LOCAL VARIABLES: ! INTEGER :: IndH2O, LM - INTEGER :: OrigUnit + INTEGER :: previous_units __Iam__('GEOS_SetH2O') @@ -499,7 +500,8 @@ SUBROUTINE GEOS_SetH2O( GC, Input_Opt, State_Met, & ! Make sure that species are in kg/kg total. This should be the case already, ! but better be safe! CALL Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & - outUnit=KG_SPECIES_PER_KG_TOTAL_AIR, OrigUnit=OrigUnit, RC=RC ) + new_units=KG_SPECIES_PER_KG_TOTAL_AIR, & + previous_units=previous_units, RC=RC ) ! Sync Q and H2O concentration array. Q is in kg/kg total, so is H2O. LM = State_Grid%NZ @@ -514,7 +516,7 @@ SUBROUTINE GEOS_SetH2O( GC, Input_Opt, State_Met, & ! Convert back to original unit CALL Convert_Spc_Units ( Input_Opt, State_Chm, State_Grid, State_Met, & - outUnit=OrigUnit, RC=RC ) + new_units=previous_units, RC=RC ) ENDIF ! All done