Skip to content

Commit

Permalink
Avoid zeroing twice in INIT_PRESSURE
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Oct 29, 2024
1 parent 9870afb commit a02905c
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions GeosUtil/pressure_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -517,50 +517,57 @@ SUBROUTINE INIT_PRESSURE( Input_Opt, State_Grid, RC )
RC = GC_SUCCESS
ThisLoc = ' -> at Init_Pressure (in GeosUtil/pressure_mod.F90)'

IF (.NOT. ALLOCATED( PFLT_DRY ))
IF (.NOT. ALLOCATED( PFLT_DRY )) THEN
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
CALL GC_CheckVar( 'vdiff_mod.F90:PFLT_DRY', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
PFLT_DRY = 0e+0_fp
END IF

IF (.NOT. ALLOCATED( PFLT_WET ))
IF (.NOT. ALLOCATED( PFLT_WET )) THEN
ALLOCATE( PFLT_WET( State_Grid%NX, State_Grid%NY ), STAT=RC )
CALL GC_CheckVar( 'vdiff_mod.F90:PFLT_WET', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
PFLT_WET = 0e+0_fp
CALL GC_CheckVar( 'vdiff_mod.F90:PFLT_WET', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
PFLT_WET = 0e+0_fp
END IF

IF (.NOT. ALLOCATED( AP ))
IF (.NOT. ALLOCATED( AP )) THEN
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
CALL GC_CheckVar( 'vdiff_mod.F90:AP', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
AP = 1e+0_fp
END IF

IF (.NOT. ALLOCATED( BP ))
IF (.NOT. ALLOCATED( BP )) THEN
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
CALL GC_CheckVar( 'vdiff_mod.F90:BP', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
BP = 0e+0_fp
END IF

IF (.NOT. ALLOCATED( AP_FULLGRID ))
IF (.NOT. ALLOCATED( AP_FULLGRID )) THEN
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
CALL GC_CheckVar( 'vdiff_mod.F90:AP_FULLGRID', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
AP = 1e+0_fp
END IF

IF (.NOT. ALLOCATED( BP_FULLGRID ))
IF (.NOT. ALLOCATED( BP_FULLGRID )) THEN
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
CALL GC_CheckVar( 'vdiff_mod.F90:BP_FULLGRID', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
BP = 0e+0_fp
END IF

#if defined( ESMF_ ) || defined( MODEL_ )
IF (.NOT. ALLOCATED( EXTERNAL_PEDGE ))
IF (.NOT. ALLOCATED( EXTERNAL_PEDGE )) THEN
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
CALL GC_CheckVar( 'vdiff_mod.F90:EXTERNAL_PEDGE', 2, RC )
IF ( RC /= GC_SUCCESS ) RETURN
EXTERNAL_PEDGE = 0e+0_fp
END IF
#endif

IF ( State_Grid%NZ == 47 ) THEN
Expand Down

0 comments on commit a02905c

Please sign in to comment.