PROGRAM PRESZ
!!***********************************************************************
!! Version "$Id:: presz.F 1703 2013-11-15 21:39:36Z coats@bdsl$"
!! EDSS/Models-3 M3TOOLS.
!! Copyright (C) 1992-2002 MCNC, (C) 1997-2013 Carlie J. Coats, Jr.,
!! (C) 2002-2012 Baron Advanced Meteorological Systems. LLC., and
!! (C) 2015 UNC Institute for the Environment.
!! Distributed under the GNU GENERAL PUBLIC LICENSE version 2
!! See file "GPL.txt" for conditions of use.
!!.........................................................................
!! program body starts at line 71
!! subroutine MAKEPZ starts at line 290
!!
!! DESCRIPTION:
!! Builds multi-layer time-independent gridded file with
!! reference PRES, TA, and Z values.
!!
!! PRECONDITIONS REQUIRED:
!! "setenv"s for output file, GRIDDESC file
!! "f90 presz.F -o presz -L/home/xcc/SunOS5 -lemstuff -lm3io -lnetcdf"
!! from a directory containing PARMS3.EXT, FDESC3.EXT, IODECL3.EXT
!!
!! SUBROUTINES AND FUNCTIONS CALLED:
!! I/O API and utility routines; Lambert conversion routines from
!! libemstuff
!!
!! REVISION HISTORY:
!! prototype 7/1996 by CJC
!! Modified 9/1999 by CJC for enhanced portability
!! Version 11/2001 by CJC for I/O API Version 2.1
!! Version 11/2007 by CJC flash-screen/contact-info update
!! Version 02/2010 by CJC for I/O API v3.1: Fortran-90 only;
!! USE M3UTILIO, and related changes.
!! Version 12/2013 by CJC: PARAMETER CMENU(:)
!! Version 02/2015 by CJC for I/O API v3.2: F90 free-format source,
!! use generics for "GET*()"
!!***********************************************************************
USE M3UTILIO
IMPLICIT NONE
!!....... Parameter
INTEGER, PARAMETER :: CTYPE( 6 ) = &
(/ LATGRD3, LAMGRD3, MERGRD3, STEGRD3, UTMGRD3, ALBGRD3 /)
CHARACTER*16, PARAMETER :: NONE = 'NONE'
CHARACTER*16, PARAMETER :: PNAME = 'PRESZ'
CHARACTER*20, PARAMETER :: CMENU( 6 ) = &
(/ 'lat-lon ', & ! coordinate types menu item 1
'Lambert Conformal ', & ! coordinate types menu item 2
'Mercator ', & ! coordinate types menu item 3
'Stereographic ', & ! coordinate types menu item 4
'UTM ', & ! coordinate types menu item 5
'Albers Equal-Area ' /) ! coordinate types menu item 6
!!........... LOCAL VARIABLES and their descriptions:
INTEGER L
REAL V
REAL P00, ZLP, PFAC, TS0, TLP !! constants defining MM5 reference atmosphere
INTEGER LOGDEV, ISTAT
LOGICAL EFLAG
CHARACTER*16 ANAME
CHARACTER*16 FNAME, TNAME
CHARACTER*160 MESG
!!***********************************************************************
!!....... First: Initialize the I/O API:
LOGDEV = INIT3() ! initialization returns unit # for log
EFLAG = .FALSE.
WRITE( *,'( 5X, A )' ) ' ', &
'Program PRESZ to construct TIME-INDEPENDENT LAYERED GRIDDED I/O API', &
' files containing an MM5-style reference atmosphere with layer-center', &
'and layer-surface altitude and reference pressure, and layer-center', &
'reference temperature, for a user specified coordinate system and grid.', &
'', &
'NOTE: Currently, only hydrostatic Sigma-P vertical coordinate systems', &
'and Lat-lon, Lambert, Mercator, Stereographic, and UTM horizontal', &
'coordinate systems are supported.', &
'', &
'PRECONDITIONS REQUIRED:', &
'', &
' setenv ', &
' setenv GRIDDESC (if no terrain file)', &
' setenv