Skip to content

Commit

Permalink
Add earlier warning in planeflight_mod.F90 for surface observations
Browse files Browse the repository at this point in the history
There was a warning in planeflight_mod.F90 when computing fields for the
planeflight diagnostic to tell users that the observation is being considered
a surface observation and thus level is forced to L=1. This warning has
been removed and instead a warning now prints when planeflight observations
are read from file. If an observation type name begins with 'S' the code will
stop letting the user know that the code automatically assumes this is a
surface observation. If that's not intended, the user may disable the code
forcing the unit change and L=1 or change the observation type name.

This fix addresses Github issue #680.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
  • Loading branch information
msulprizio committed Apr 28, 2021
1 parent 815c8fa commit 334b22b
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions GeosCore/planeflight_mod.F90
Expand Up @@ -1092,6 +1092,24 @@ SUBROUTINE READ_POINTS( Input_Opt, State_Grid, State_Met, IU_FILE, RC )
TRIM(NAME) .EQ. 'Twbi' .OR. & ! NOAA Tower
TRIM(NAME) .EQ. 'Twgc' .OR. & ! NOAA Tower
TRIM(NAME) .EQ. 'Twkt' ) THEN ! NOAA Tower

! Make sure it is the users intention for 'S' to represent
! surface observations
IF ( NAME(1:1) .EQ. 'S' .and. Input_Opt%amIRoot ) THEN
WRITE( 6, '(a)') 'WARNING: Names beginning with "S" are '
WRITE( 6, '(a)') 'assumed to be NOAA Surface observations. '
WRITE( 6, '(a)') 'Vertical coordinates are assumed to be '
WRITE( 6, '(a)') 'altitude and will be converted to pressure. '
WRITE( 6, '(a)') 'In routine PLANEFLIGHT, L=1 is forced. '
WRITE( 6, '(a)') 'If this is intended, you may comment out the '
WRITE( 6, '(a)') 'call to GEOS_CHEM_STOP in routine '
WRITE( 6, '(a)') 'READ_POINTS (planeflight_mod.F90). Otherwise,'
WRITE( 6, '(a)') 'remove "S" from the IF statement in the same '
WRITE( 6, '(a)') 'location.'
WRITE( 6, '(a)') REPEAT( '=', 79 )
ENDIF
CALL GEOS_CHEM_STOP

! Change units
! NOTE: PHIS is now in units of [m], so we don't need to
! divide by g0 again (see issue geoschem/geos-chem #531)
Expand Down Expand Up @@ -1660,27 +1678,13 @@ SUBROUTINE PLANEFLIGHT( Input_Opt, State_Chm, State_Diag, &
! Return grid box indices for the chemistry region
CALL TEST_VALID( M, I, J, L, Input_Opt, State_Grid, State_Met, RC )

! If this is a surface observation, set L=1
! If this is a surface observation, force L=1
!
! NOAA Surface observations start with 'S' in Planeflight.dat
! Other surface observation strings can be added here
NAME = ADJUSTL(PTYPE(M))
IF ( NAME(1:1) .EQ. 'S' ) THEN

! Make sure it is the users intention to set L=1
IF ( Input_Opt%amIRoot ) THEN
WRITE( 6, '(a)') 'WARNING: NOAA Surface Observation. '
WRITE( 6, '(a)') 'Forcing L=1. If this is intended, '
WRITE( 6, '(a)') 'you may comment out the call to '
WRITE( 6, '(a)') 'GEOS_CHEM_STOP in routine '
WRITE( 6, '(a)') 'PLANEFLIGHT (planeflight_mod.F90)'
WRITE( 6, '(a)') REPEAT( '=', 79 )
ENDIF
CALL GEOS_CHEM_STOP

! Force L=1
L = 1

ENDIF

! Initialize reaction counter
Expand Down

0 comments on commit 334b22b

Please sign in to comment.