! +-======-+ ! Copyright (c) 2003-2007 United States Government as represented by ! the Admistrator of the National Aeronautics and Space Administration. ! All Rights Reserved. ! ! THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, ! REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN ! COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS ! REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). ! THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN ! INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR ! REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, ! DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED ! HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE ! RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. ! ! Government Agency: National Aeronautics and Space Administration ! Government Agency Original Software Designation: GSC-15354-1 ! Government Agency Original Software Title: GEOS-5 GCM Modeling Software ! User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov ! Government Agency Point of Contact for Original Software: ! Dale Hithon, SRA Assistant, (301) 286-2691 ! ! +-======-+ subroutine MAPL_DefGridName (im,jm,gridname,iamroot) implicit none integer,intent(in)::im,jm logical,intent(in)::iamroot character(len=*),intent(out)::gridname character(len=2) poletype character(len=3) llcb character(len=30) myfmt poletype='PC' if(mod(jm,2)==0) poletype='PE' llcb='-DC' ! lat-lon if(6*im==jm) llcb='-CF' ! cubed ! there has to be a smarter way to do this format if(im>10.and.im<100.and.& jm>10.and.jm<100) then myfmt='(a,i2,a,i2,a)' endif if(im>100.and.im<1000.and.& jm>10.and.jm<100) then myfmt='(a,i3,a,i2,a)' endif if(im>100.and.im<1000.and.& jm>100.and.jm<1000) then myfmt='(a,i3,a,i3,a)' endif if(im>1000.and.im<10000.and.& jm>100 .and.jm<1000) then myfmt='(a,i4,a,i3,a)' endif if(im>100 .and.im<1000.and.& jm>1000.and.jm<100) then myfmt='(a,i3,a,i4,a)' endif if(im>1000.and.im<10000.and.& jm>1000.and.jm<10000) then myfmt='(a,i4,a,i4,a)' endif write(gridname,fmt=trim(myfmt)) trim(poletype),im,'x',jm,trim(llcb) if(iamroot)print*,'MAPL_DefGridName: ',trim(gridname) end subroutine MAPL_DefGridName