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

Add MODEL_GISS pre-processing statement to enable GISS-GC #2499

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions GeosCore/calc_met_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MODULE CALC_MET_MOD
!
PUBLIC :: AVGPOLE
PUBLIC :: AIRQNT
PUBLIC :: GET_COSINE_SZA
PUBLIC :: GET_COSINE_SZA
PUBLIC :: GET_OBK
PUBLIC :: INTERP
PUBLIC :: SET_DRY_SURFACE_PRESSURE
Expand Down Expand Up @@ -1216,9 +1216,11 @@ SUBROUTINE GET_COSINE_SZA( Input_Opt, State_Grid, State_Met, RC )
( MINUTE/1440d0 ) + ( SECOND/3600d0 )
JD = JULDAY( YEAR, MONTH, DDAY ) ! Current Julian date

#if !defined( MODEL_GISS )
! Compute cosine(SZA) quantities for the current time
CALL COSSZA( DOY, HOUR, State_Grid, State_Met )

#endif

! Compute sum of COSSZA for HEMCO
CALL Calc_SumCosZa ( State_Grid, State_Met )

Expand Down
6 changes: 3 additions & 3 deletions GeosCore/fullchem_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ SUBROUTINE Do_FullChem( Input_Opt, State_Chm, State_Diag, &
CALL Timer_Start( "=> Gas-phase chem", RC )
ENDIF

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
! Init diagnostics
IF ( ASSOCIATED(State_Diag%KppError) ) THEN
State_Diag%KppError(:,:,:) = 0.0
Expand Down Expand Up @@ -1009,7 +1009,7 @@ SUBROUTINE Do_FullChem( Input_Opt, State_Chm, State_Diag, &
ENDIF
ENDIF

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
! Keep track of number of error boxes
IF ( State_Diag%Archive_KppError ) THEN
State_Diag%KppError(I,J,L) = State_Diag%KppError(I,J,L) + 1.0
Expand Down Expand Up @@ -1187,7 +1187,7 @@ SUBROUTINE Do_FullChem( Input_Opt, State_Chm, State_Diag, &
WRITE(6, '(a )' ) '## INTEGRATE FAILED TWICE !!! '
WRITE(ERRMSG,'(a,i3)' ) 'Integrator error code :', IERR

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
IF ( Input_Opt%KppStop ) THEN
CALL ERROR_STOP(ERRMSG, 'INTEGRATE_KPP')
ELSE
Expand Down
6 changes: 4 additions & 2 deletions GeosCore/gc_environment_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ SUBROUTINE GC_Init_StateObj( Diag_List, TaggedDiag_List, Input_Opt, &
State_Grid = State_Grid, & ! Grid State
State_Met = State_Met, & ! Meteorology State
RC = RC ) ! Success or failure?

! Trap potential errors
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered within call to "Init_State_Met"!'
Expand Down Expand Up @@ -480,6 +480,7 @@ SUBROUTINE GC_Init_Extra( Diag_List, Input_Opt, State_Chm, &
RETURN
ENDIF

#if ! defined( MODEL_GISS )
!=======================================================================
! Initialize the hybrid pressure module. Define Ap and Bp.
!=======================================================================
Expand All @@ -489,7 +490,8 @@ SUBROUTINE GC_Init_Extra( Diag_List, Input_Opt, State_Chm, &
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF

#endif

!=======================================================================
! Call setup routines for drydep
!=======================================================================
Expand Down
2 changes: 1 addition & 1 deletion GeosCore/hco_interface_gc_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ SUBROUTINE HCOI_GC_Run( Input_Opt, State_Chm, State_Grid, &
ENDIF
ENDIF

#if !defined( ESMF_ ) && !defined( MODEL_WRF )
#if !defined( ESMF_ ) && !defined( MODEL_WRF ) && !defined( MODEL_GISS )
! Check if HEMCO has already been called for this timestep
IF ( ( Phase == 1 ) .and. ( GET_TAU() == PrevTAU ) .and. Input_Opt%amIRoot ) THEN
Print*, 'HEMCO already called for this timestep. Returning.'
Expand Down
4 changes: 2 additions & 2 deletions GeosUtil/gc_grid_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MODULE GC_Grid_Mod
#endif
PUBLIC :: GET_IJ
PUBLIC :: SetGridFromCtr
#if defined ( MODEL_WRF ) || defined( MODEL_CESM )
#if defined ( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
PUBLIC :: SetGridFromCtrEdges
#endif
!
Expand Down Expand Up @@ -823,7 +823,7 @@ SUBROUTINE SetGridFromCtr( Input_Opt, State_Grid, lonCtr, latCtr, RC )

END SUBROUTINE SetGridFromCtr
!EOC
#if defined ( MODEL_WRF ) || defined( MODEL_CESM )
#if defined ( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
!------------------------------------------------------------------------------
! GEOS-Chem Global Chemical Transport Model !
!------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions GeosUtil/pressure_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MODULE PRESSURE_MOD
#if defined( ESMF_ ) || defined( MODEL_ )
PUBLIC :: Accept_External_Pedge
#endif
#if defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
PUBLIC :: Accept_External_ApBp
#endif
!
Expand Down Expand Up @@ -1039,7 +1039,7 @@ SUBROUTINE INIT_PRESSURE( Input_Opt, State_Grid, RC )
BP(L) = b132_loc(State_Grid%NZ+2-L)
ENDDO

#if !defined( MODEL_WRF ) && !defined( MODEL_CESM )
#if !defined( MODEL_WRF ) && !defined( MODEL_CESM ) && !defined( MODEL_GISS )
ELSE

WRITE( nLev, * ) State_Grid%NZ
Expand Down Expand Up @@ -1168,7 +1168,7 @@ SUBROUTINE Accept_External_Pedge( State_Met, State_Grid, RC )
END SUBROUTINE Accept_External_Pedge
!EOC
#endif
#if defined ( MODEL_WRF ) || defined( MODEL_CESM )
#if defined ( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
!------------------------------------------------------------------------------
! GEOS-Chem Global Chemical Transport Model !
!------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Headers/input_opt_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ MODULE Input_Opt_Mod
LOGICAL :: TurnOffHetRates
#endif

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
LOGICAL :: KppStop = .TRUE. ! Stop KPP if integration fails twice
#endif

Expand Down
10 changes: 5 additions & 5 deletions Headers/state_diag_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ MODULE State_Diag_Mod
LOGICAL :: Archive_CO2photrate
#endif

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
!----------------------------------------------------------------------
! The following diagnostics are only used when
! GEOS-Chem is interfaced into WRF (as WRF-GC) or CESM
Expand Down Expand Up @@ -2842,7 +2842,7 @@ SUBROUTINE Zero_State_Diag( State_Diag, RC )
State_Diag%Archive_CO2photrate = .FALSE.
#endif

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
!=======================================================================
! These diagnostics are only activated when running GC
! either in NASA/GEOS, WRF, or CESM
Expand Down Expand Up @@ -7036,7 +7036,7 @@ SUBROUTINE Init_State_Diag( Input_Opt, State_Chm, State_Grid, &
RETURN
ENDIF

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
!--------------------------------------------------------------------
! KPP error flag
!--------------------------------------------------------------------
Expand Down Expand Up @@ -14412,7 +14412,7 @@ SUBROUTINE Cleanup_State_Diag( State_Diag, RC )
IF ( RC /= GC_SUCCESS ) RETURN
#endif

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
!=======================================================================
! These fields are only used when GEOS-Chem
! is interfaced to NASA/GEOS, WRF (as WRF-GC), or CESM
Expand Down Expand Up @@ -15459,7 +15459,7 @@ SUBROUTINE Get_Metadata_State_Diag( am_I_Root, metadataID, Found, &
IF ( isUnits ) Units = 'kg m-2 s-1'
IF ( isRank ) Rank = 2

#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM )
#if defined( MODEL_GEOS ) || defined( MODEL_WRF ) || defined( MODEL_CESM ) || defined( MODEL_GISS )
ELSE IF ( TRIM( Name_AllCaps ) == 'KPPERROR' ) THEN
IF ( isDesc ) Desc = 'KppError'
IF ( isUnits ) Units = '1'
Expand Down
Loading