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 allocate guards for arrays in pressure_mod #2532

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This file documents all notable changes to the GEOS-Chem repository starting in

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Fixed
- Added allocate guards for arrays in `pressure_mod`

## [14.4.3] - 2024-08-13
### Added
- Added ModelEe.2 (GCAP 2.0) simulation to integration tests for GCClassic
Expand Down
24 changes: 16 additions & 8 deletions GeosUtil/pressure_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -517,39 +517,47 @@ SUBROUTINE INIT_PRESSURE( Input_Opt, State_Grid, RC )
RC = GC_SUCCESS
ThisLoc = ' -> at Init_Pressure (in GeosUtil/pressure_mod.F90)'

ALLOCATE( PFLT_DRY( State_Grid%NX, State_Grid%NY ), STAT=RC )
IF (.NOT. ALLOCATED( PFLT_DRY ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( PFLT_DRY( State_Grid%NX, State_Grid%NY ), STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:PFLT_DRY', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
PFLT_DRY = 0e+0_fp

ALLOCATE( PFLT_WET( State_Grid%NX, State_Grid%NY ), STAT=RC )
IF (.NOT. ALLOCATED( PFLT_WET ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( PFLT_WET( State_Grid%NX, State_Grid%NY ), STAT=RC )
yantosca marked this conversation as resolved.
Show resolved Hide resolved
CALL GC_CheckVar( 'vdiff_mod.F90:PFLT_WET', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
PFLT_WET = 0e+0_fp

ALLOCATE( AP( State_Grid%NZ+1 ), STAT=RC )
IF (.NOT. ALLOCATED( AP ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( AP( State_Grid%NZ+1 ), STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:AP', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
AP = 1e+0_fp

ALLOCATE( BP( State_Grid%NZ+1 ), STAT=RC )
IF (.NOT. ALLOCATED( BP ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( BP( State_Grid%NZ+1 ), STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:BP', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
BP = 0e+0_fp

ALLOCATE( AP_FULLGRID( State_Grid%NativeNZ+1 ), STAT=RC )
IF (.NOT. ALLOCATED( AP_FULLGRID ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( AP_FULLGRID( State_Grid%NativeNZ+1 ), STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:AP_FULLGRID', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
AP = 1e+0_fp

ALLOCATE( BP_FULLGRID( State_Grid%NativeNZ+1 ), STAT=RC )
IF (.NOT. ALLOCATED( BP_FULLGRID ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( BP_FULLGRID( State_Grid%NativeNZ+1 ), STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:BP_FULLGRID', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
BP = 0e+0_fp

#if defined( ESMF_ ) || defined( MODEL_ )
ALLOCATE( EXTERNAL_PEDGE( State_Grid%NX, State_Grid%NY, State_Grid%NZ+1 ), &
STAT=RC )
IF (.NOT. ALLOCATED( EXTERNAL_PEDGE ))
yantosca marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE( EXTERNAL_PEDGE( State_Grid%NX, State_Grid%NY, &
State_Grid%NZ+1 ), &
STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:EXTERNAL_PEDGE', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
EXTERNAL_PEDGE = 0e+0_fp
Expand Down