Skip to content

Commit

Permalink
change order to move ALLOCATE call for earth_u_profile and earth_v_pr…
Browse files Browse the repository at this point in the history
…ofile after RETURN logic
  • Loading branch information
likeuclinux committed Jan 28, 2025
1 parent 2f39849 commit be5b815
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions share/wrf_timeseries.F
Original file line number Diff line number Diff line change
Expand Up @@ -351,27 +351,21 @@ SUBROUTINE calc_ts( grid )
! FALSE to output T and Q at 2-m and wind at 10-m diagnostic levels:
LOGICAL, PARAMETER :: ts_model_level = .FALSE.

!Allocate the arrays for wind components
#if ( EM_CORE == 1 )
ALLOCATE ( earth_u_profile(grid%max_ts_level), earth_v_profile(grid%max_ts_level) )
#endif

IF ( grid%ntsloc_domain .LE. 0 ) THEN
#if ( EM_CORE == 1 )
DEALLOCATE(earth_u_profile, earth_v_profile)
#endif
RETURN
END IF

#if ((EM_CORE == 1) && (DA_CORE != 1))
IF ( grid%dfi_opt /= DFI_NODFI .AND. grid%dfi_stage /= DFI_FST ) THEN
#if ( EM_CORE == 1 )
DEALLOCATE(earth_u_profile, earth_v_profile)
#endif
RETURN
END IF
#endif

!Allocate the arrays for wind components
#if ( EM_CORE == 1 )
ALLOCATE ( earth_u_profile(grid%max_ts_level), earth_v_profile(grid%max_ts_level) )
#endif

n = grid%next_ts_time

ALLOCATE(p8w(grid%sm32:grid%em32))
Expand Down

0 comments on commit be5b815

Please sign in to comment.