Skip to content

Commit

Permalink
Fix problem with orog program when using MacOS
Browse files Browse the repository at this point in the history
Rearrange the allocation of the "hgt_1d" array in mtnlm7_oclsm.f 
to fix errors on MacOS.  Add matching deallocate statement.  Fix 
subroutine name in comment.

Fixes #243 #245 #277
  • Loading branch information
kgerheiser authored Feb 11, 2021
1 parent c5fafb4 commit ea2bce4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,7 @@ SUBROUTINE MAKEMT2(ZAVG,ZSLM,ORO,SLM,land_frac,VAR,VAR4,
implicit none
real, parameter :: D2R = 3.14159265358979/180.
integer, parameter :: MAXSUM=20000000
real hgt_1d(MAXSUM)
real, dimension(:), allocatable :: hgt_1d
integer IM, JM, IMN, JMN
real GLAT(JMN), GLON(IMN)
INTEGER ZAVG(IMN,JMN),ZSLM(IMN,JMN)
Expand All @@ -1797,6 +1797,7 @@ SUBROUTINE MAKEMT2(ZAVG,ZSLM,ORO,SLM,land_frac,VAR,VAR4,
! --- mskocn=1 Use ocean model sea land mask, OK and present,
! --- mskocn=0 dont use Ocean model sea land mask, not OK, not present
print *,' _____ SUBROUTINE MAKEMT2 '
allocate(hgt_1d(MAXSUM))
C---- GLOBAL XLAT AND XLON ( DEGREE )
C
JM1 = JM - 1
Expand Down Expand Up @@ -1892,9 +1893,9 @@ SUBROUTINE MAKEMT2(ZAVG,ZSLM,ORO,SLM,land_frac,VAR,VAR4,
ENDDO
ENDDO
!$omp end parallel do
WRITE(6,*) "! MAKEMT ORO SLM VAR VAR4 DONE"
WRITE(6,*) "! MAKEMT2 ORO SLM VAR VAR4 DONE"
C
deallocate(hgt_1d)
RETURN
END
Expand Down

0 comments on commit ea2bce4

Please sign in to comment.