subroutine prlevel(ipdtn,ipdtmpl,labbrev) integer,intent(in) :: ipdtn integer,intent(in) :: ipdtmpl(*) character(len=20),intent(out) :: labbrev character(len=10) :: tmpval1,tmpval2 labbrev(1:20)=" " if ( ipdtmpl(10) .eq. 100 .and. ! Pressure Level & ipdtmpl(13) .eq. 255 ) then !write(tmpval1,*) ipdtmpl(12)/100 call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)+2) labbrev=trim(tmpval1)//" mb" elseif ( ipdtmpl(10) .eq. 100 .and. ! Pressure Layer & ipdtmpl(13) .eq. 100 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)+2) call frmt(tmpval2,ipdtmpl(15),ipdtmpl(14)+2) labbrev=trim(tmpval1)//" - "//trim(tmpval2)//" mb" elseif ( ipdtmpl(10) .eq. 101 ) then ! Mean Sea Level labbrev(1:20)=" Mean Sea Level " elseif ( ipdtmpl(10) .eq. 102 .and. ! Altitude above MSL & ipdtmpl(13) .eq. 255 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) labbrev=trim(tmpval1)//" m above MSL" elseif ( ipdtmpl(10) .eq. 103 .and. ! Height above Ground & ipdtmpl(13) .eq. 255 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) labbrev=trim(tmpval1)//" m above ground" elseif ( ipdtmpl(10) .eq. 103 .and. ! Height above Ground & ipdtmpl(13) .eq. 103 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)+2) call frmt(tmpval2,ipdtmpl(15),ipdtmpl(14)+2) labbrev=trim(tmpval1)//" - "//trim(tmpval2)//" m HGTY" elseif ( ipdtmpl(10) .eq. 104 .and. ! Sigma Level & ipdtmpl(13) .eq. 255 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) labbrev=trim(tmpval1)//" sigma" elseif ( ipdtmpl(10) .eq. 104 .and. ! Sigma Layer & ipdtmpl(13) .eq. 104 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) call frmt(tmpval2,ipdtmpl(15),ipdtmpl(14)) labbrev=trim(tmpval1)//" - "//trim(tmpval2)//" sigma" elseif ( ipdtmpl(10) .eq. 105 .and. ! Hybrid Level & ipdtmpl(13) .eq. 255 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) labbrev=trim(tmpval1)//" hybrid lvl" elseif ( ipdtmpl(10).eq.105 .and. ! Hybrid Level & ipdtmpl(13).eq.105) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) call frmt(tmpval2,ipdtmpl(15),ipdtmpl(14)) labbrev=trim(tmpval1)//" - "//trim(tmpval2)//" hybrid lvl" elseif ( ipdtmpl(10) .eq. 106 .and. ! Depth Below Land Sfc & ipdtmpl(13) .eq. 255 ) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) labbrev=trim(tmpval1)//" m below land" elseif ( ipdtmpl(10).eq.106 .and. ! Depth Below Land Sfc Layer & ipdtmpl(13).eq.106) then call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)) call frmt(tmpval2,ipdtmpl(15),ipdtmpl(14)) labbrev=trim(tmpval1)//" - "//trim(tmpval2)//" m DBLY" elseif ( ipdtmpl(10) .eq. 107 ) then ! Isentrophic (theta) level (THEL) labbrev(1:20)=" Isentropic level" elseif ( ipdtmpl(10).eq.108 .and. ! Press Diff from Ground Layer & ipdtmpl(13).eq.108) then !write(tmpval1,*) ipdtmpl(12)/100 !write(tmpval2,*) ipdtmpl(15)/100 call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)+2) call frmt(tmpval2,ipdtmpl(15),ipdtmpl(14)+2) labbrev=trim(tmpval1)//" - "//trim(tmpval2)//" mb SPDY" elseif ( ipdtmpl(10) .eq. 110 ) then ! Layer between two hybrid levels (HYBY) labbrev(1:20)=" Layer bet 2-hyb lvl" elseif ( ipdtmpl(10).eq.109 .and. ! Potential Vorticity Sfc & ipdtmpl(13).eq.255) then !write(tmpval1,*) ipdtmpl(12) call frmt(tmpval1,ipdtmpl(12),ipdtmpl(11)-6) labbrev=trim(tmpval1)//" pv surface" elseif ( ipdtmpl(10) .eq. 111 ) then ! Eta Level (EtaL) labbrev(1:20)=" Eta level" elseif ( ipdtmpl(10) .eq. 114 ) then ! Layer between two isentropic levels (THEY) labbrev(1:20)=" Layer bet. 2-isent." elseif ( ipdtmpl(10) .eq. 117 ) then ! Mixed layer depth labbrev(1:20)=" Mixed layer depth" elseif ( ipdtmpl(10) .eq. 120 ) then ! Layer between two Eta levels (EtaY) labbrev(1:20)=" Layer bet. 2-Eta lvl" elseif ( ipdtmpl(10) .eq. 121 ) then ! Layer between two isobaric surface (IBYH) labbrev(1:20)=" Layer bet. 2-isob." elseif ( ipdtmpl(10) .eq. 125 ) then ! Specified height level above ground (HGLH) labbrev(1:20)=" Specified height lvl" elseif ( ipdtmpl(10) .eq. 126 ) then ! Isobaric Level (ISBP) labbrev(1:20)=" Isobaric level" elseif ( ipdtmpl(10) .eq. 160 ) then ! Depth below sea level labbrev(1:20)=" Depth below sea lvl" elseif ( ipdtmpl(10) .eq. 1 ) then ! Ground/Water Surface labbrev(1:20)=" Surface " elseif ( ipdtmpl(10) .eq. 2 ) then ! Cloud base level (CBL) labbrev(1:20)=" Cloud base lvl" elseif ( ipdtmpl(10) .eq. 3 ) then ! Cloud top level (CTL) labbrev(1:20)=" Cloud top lvl" elseif ( ipdtmpl(10) .eq. 4 ) then ! Freezing Level labbrev(1:20)=" 0 Deg Isotherm" elseif ( ipdtmpl(10) .eq. 5 ) then ! Level of adiabatic condensation lifted labbrev(1:20)=" Level of adiabatic" ! from the surface elseif ( ipdtmpl(10) .eq. 6 ) then ! Max Wind Level labbrev(1:20)=" Max wind lvl" elseif ( ipdtmpl(10) .eq. 7 ) then ! Tropopause labbrev(1:20)=" Tropopause" elseif ( ipdtmpl(10) .eq. 8 ) then ! Nominal top of Atmosphere labbrev(1:20)=" Nom. top" elseif ( ipdtmpl(10) .eq. 9 ) then ! Sea bottom labbrev(1:20)=" Sea Bottom" elseif ( ipdtmpl(10) .eq. 10 ) then ! Entire Atmosphere (EATM) labbrev(1:20)=" Entire Atmosphere" elseif ( ipdtmpl(10) .eq. 11 ) then ! Cumulonimbus Base labbrev(1:20)=" Cumulonimbus Base" elseif ( ipdtmpl(10) .eq. 12 ) then ! Cumulonimbus Top labbrev(1:20)=" Cumulonimbus Top" elseif ( ipdtmpl(10) .eq. 20 ) then ! Isothermal level labbrev(1:20)=" Isothermal level" elseif ( ipdtmpl(10) .eq. 200 ) then ! Entire Atmosphere (EATM) labbrev(1:20)=" Entire Atmosphere" elseif ( ipdtmpl(10) .eq. 201 ) then ! Entire ocean (EOCN) labbrev(1:20)=" Entire ocean" elseif ( ipdtmpl(10) .eq. 204 ) then ! Highest tropospheric freezing level (HTFL) labbrev(1:20)=" Highest Frz. lvl" elseif ( ipdtmpl(10) .eq. 206 ) then ! Grid scale cloud bottom level (GCBL) labbrev(1:20)=" Grid scale cloud bl" elseif ( ipdtmpl(10) .eq. 207 ) then ! Grid scale cloud top level (GCTL) labbrev(1:20)=" Grid scale cloud tl" elseif ( ipdtmpl(10) .eq. 209 ) then ! Boundary layer cloud bottom level (BCBL) labbrev(1:20)=" Boundary layer cbl" elseif ( ipdtmpl(10) .eq. 210 ) then ! Boundary layer cloud top level (BCTL) labbrev(1:20)=" Boundary layer ctl" elseif ( ipdtmpl(10) .eq. 211 ) then ! Boundary layer cloud layer (BCY) labbrev(1:20)=" Boundary layer cl" elseif ( ipdtmpl(10) .eq. 212 ) then ! Low cloud bottom level (LCBL) labbrev(1:20)=" Low cloud bot. lvl" elseif ( ipdtmpl(10) .eq. 213 ) then ! Low cloud top level (LCTL) labbrev(1:20)=" Low cloud top lvl" elseif ( ipdtmpl(10) .eq. 214 ) then ! Low cloud layer (LCY) labbrev(1:20)=" Low cloud layer" elseif ( ipdtmpl(10) .eq. 215 ) then ! Cloud ceiling (CEIL) labbrev(1:20)=" Cloud ceiling" elseif ( ipdtmpl(10) .eq. 220 ) then ! Planetary Boundary Layer (PBLRI) labbrev(1:20)=" Planetary boundary" elseif ( ipdtmpl(10) .eq. 221 ) then ! Layer Between Two Hybrid Levels (HYBY) labbrev(1:20)=" Layer 2 Hybrid lvl " elseif ( ipdtmpl(10) .eq. 222 ) then ! Middle cloud bottom level (MCBL) labbrev(1:20)=" Mid. cloud bot. lvl" elseif ( ipdtmpl(10) .eq. 223 ) then ! Middle cloud top level (MCTL) labbrev(1:20)=" Mid. cloud top lvl" elseif ( ipdtmpl(10) .eq. 224 ) then ! Middle cloud layer (MCY) labbrev(1:20)=" Middle cloud layer" elseif ( ipdtmpl(10) .eq. 232 ) then ! High cloud bottom level (HCBL) labbrev(1:20)=" High cloud bot. lvl" elseif ( ipdtmpl(10) .eq. 233 ) then ! High cloud top level (HCTL) labbrev(1:20)=" High cloud top lvl" elseif ( ipdtmpl(10) .eq. 234 ) then ! High cloud layer (HCY) labbrev(1:20)=" High cloud layer" elseif ( ipdtmpl(10) .eq. 235 ) then ! Ocean isotherm level (OITL) labbrev(1:20)=" Ocean Isotherm lvl" elseif ( ipdtmpl(10) .eq. 236 ) then ! Layer between two depth below ocean sfc (OLYR) labbrev(1:20)=" Layer 2-depth below" elseif ( ipdtmpl(10) .eq. 237 ) then ! Bottom of Ocean mixed layer (OBML) labbrev(1:20)=" Bot. Ocean mix. lyr" elseif ( ipdtmpl(10) .eq. 238 ) then ! Bottom of Ocean iisothermal layer (OBIL) labbrev(1:20)=" Bot. Ocean iso. lyr" elseif ( ipdtmpl(10) .eq. 239 ) then ! Layer ocean surface and 26C ocean labbrev(1:20)=" layer ocean sfc 26C" ! isothermal level (S26CY) elseif ( ipdtmpl(10) .eq. 240 ) then ! Ocean Mixed Layer labbrev(1:20)=" Ocean Mixed Layer" elseif ( ipdtmpl(10) .eq. 241 ) then ! Ordered Sequence of Data labbrev(1:20)=" Order Seq. Of Data" elseif ( ipdtmpl(10) .eq. 242 ) then ! Convective cloud bottom level (CCBL) labbrev(1:20)=" Con. cloud bot. lvl" elseif ( ipdtmpl(10) .eq. 243 ) then ! Convective cloud top level (CCTL) labbrev(1:20)=" Con. cloud top lvl" elseif ( ipdtmpl(10) .eq. 244 ) then ! Convective cloud layer (CCY) labbrev(1:20)=" Conv. cloud layer" elseif ( ipdtmpl(10) .eq. 245 ) then ! Lowest level of the wet bulb zero (LLTW) labbrev(1:20)=" Lowest lvl wet bulb" elseif ( ipdtmpl(10) .eq. 246 ) then ! Maximum equiv. potential temp. level (MTHE) labbrev(1:20)=" Max. equi. potential" elseif ( ipdtmpl(10) .eq. 247 ) then ! Equilibrium level (EHLT) labbrev(1:20)=" Equilibrium level" elseif ( ipdtmpl(10) .eq. 248 ) then ! Shallow convective cloud bottom level (SCBL) labbrev(1:20)=" Shallow con. cld bl" elseif ( ipdtmpl(10) .eq. 249 ) then ! Shallow convective cloud top level (SCTL) labbrev(1:20)=" Shallow con. cld tl" elseif ( ipdtmpl(10) .eq. 251 ) then ! Deep convective cloud bottom level (DCBL) labbrev(1:20)=" Deep conv. cld bl" elseif ( ipdtmpl(10) .eq. 252 ) then ! Deep convective cloud top level (DCTL) labbrev(1:20)=" Deep conv. cld tl" elseif ( ipdtmpl(10) .eq. 253 ) then ! Lowest bottom level of supercooled labbrev(1:20)=" Lowest bot. lvl sup" ! liquid water layer (LBLSW) elseif ( ipdtmpl(10) .eq. 254 ) then ! Highest top level of supercooled labbrev(1:20)=" highest top lvl sup" ! liquid water layer (HBLSW) else write(labbrev,fmt='(1x,i4," (Unknown Lvl)")') & ipdtmpl(10) endif return end subroutine frmt(cval,ival,iscal) character(len=10),intent(out) :: cval integer,intent(in) :: ival,iscal real :: rval integer :: newscal character(len=7) :: cformat if ( iscal .eq. 0 ) then write(cval,*) ival else newscal=-1*iscal rval=real(ival)*(10.0**newscal) if ( rval .eq. real(nint(rval)) ) then write(cval,*) nint(rval) else write(cformat,fmt='("(f0.",I1,")")') iabs(iscal) !write(6,*) "SAGF:",cformat write(cval,fmt=cformat) rval endif endif return end