Skip to content

Commit

Permalink
Backport MAPL_DefGridName from develop to v2.47.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Oct 24, 2024
1 parent 98273b3 commit d8c5f0b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.47.1.1] - 2024-10-24

### Changed

- Minor revision (and generalization) of grid-def for GSI purposes

## [2.47.1] - 2024-07-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

project (
MAPL
VERSION 2.47.1
VERSION 2.47.1.1
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the possible values of build type for cmake-gui
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 d8c5f0b

Please sign in to comment.