diff --git a/CHANGELOG.md b/CHANGELOG.md index 96cfc44e83e..fa4eb130626 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Allow update offsets of ±timestep in ExtData2G +- Minor revision (and generalization) of grid-def for GSI purposes ### Changed diff --git a/base/MAPL_DefGridName.F90 b/base/MAPL_DefGridName.F90 index c6eeb8504f0..72372da7199 100644 --- a/base/MAPL_DefGridName.F90 +++ b/base/MAPL_DefGridName.F90 @@ -5,38 +5,16 @@ subroutine MAPL_DefGridName (im,jm,gridname,iamroot) character(len=*),intent(out)::gridname character(len=2) poletype character(len=3) llcb -character(len=30) myfmt +character(len=30) imstr,jmstr 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) +write(imstr,'(I0)') im +write(jmstr,'(I0)') jm + +gridname=trim(poletype)//trim(imstr) // 'x' // trim(jmstr) // trim(llcb) + end subroutine MAPL_DefGridName