Skip to content

Commit

Permalink
Merge pull request #3120 from GEOS-ESM/feature/rtodling/used_in_gsi
Browse files Browse the repository at this point in the history
This grid-def file is used in GSI
  • Loading branch information
tclune authored Oct 24, 2024
2 parents 812150b + edb9eba commit fd4b1b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
34 changes: 6 additions & 28 deletions base/MAPL_DefGridName.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fd4b1b4

Please sign in to comment.