From cc66518878c69780a6b9dd8888ba1e32991e3b43 Mon Sep 17 00:00:00 2001 From: Ricardo Todling Date: Thu, 24 Oct 2024 12:23:41 -0400 Subject: [PATCH 1/3] simpler - better -grid name def - used in GSI --- base/MAPL_DefGridName.F90 | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/base/MAPL_DefGridName.F90 b/base/MAPL_DefGridName.F90 index c6eeb8504f03..101b3f183cc2 100644 --- a/base/MAPL_DefGridName.F90 +++ b/base/MAPL_DefGridName.F90 @@ -5,38 +5,17 @@ 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,*) im +write(jmstr,*) jm + +gridname=trim(poletype)//trim(adjustl(imstr))//'x'//& + trim(adjustl(jmstr))//trim(llcb) + end subroutine MAPL_DefGridName From 5c37df7aed81aba3558bf121d65d90b4f44575cd Mon Sep 17 00:00:00 2001 From: Ricardo Todling Date: Thu, 24 Oct 2024 12:37:23 -0400 Subject: [PATCH 2/3] about --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d1fbb5bc9e..be9a58f54a58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,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 From edb9ebaecec0bacc251296332835594f419f6df8 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 24 Oct 2024 13:25:04 -0400 Subject: [PATCH 3/3] Update base/MAPL_DefGridName.F90 --- base/MAPL_DefGridName.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/base/MAPL_DefGridName.F90 b/base/MAPL_DefGridName.F90 index 101b3f183cc2..72372da7199c 100644 --- a/base/MAPL_DefGridName.F90 +++ b/base/MAPL_DefGridName.F90 @@ -12,10 +12,9 @@ subroutine MAPL_DefGridName (im,jm,gridname,iamroot) llcb='-DC' ! lat-lon if(6*im==jm) llcb='-CF' ! cubed -write(imstr,*) im -write(jmstr,*) jm +write(imstr,'(I0)') im +write(jmstr,'(I0)') jm -gridname=trim(poletype)//trim(adjustl(imstr))//'x'//& - trim(adjustl(jmstr))//trim(llcb) +gridname=trim(poletype)//trim(imstr) // 'x' // trim(jmstr) // trim(llcb) end subroutine MAPL_DefGridName